Commit 49baed67 authored by Neeme Kahusk's avatar Neeme Kahusk

featured_rows

parent 189565e9
......@@ -48,6 +48,17 @@ def zip2roots(infile: str) -> list:
return olist
def featured_rows(list_of_roots: list, labels: list):
out = []
for i in list_of_roots:
rida = {}
for t in labels:
rida[t['label_et']] = get_xpath(i, t['xpath'])
out.append(rida)
rida = {}
return out
def main():
parser = argparse.ArgumentParser(description='Avab zip faili')
parser.add_argument('infile')
......@@ -61,16 +72,10 @@ def main():
if args.zip:
tulem = zip2roots(args.infile)
out = []
for i in tulem:
print(i)
for t in labels:
print(t['label_et'], t['xpath'])
out.append({t['label_et']:get_xpath(i, t['xpath'])})
print(5*'--')
tulemitabel = featured_rows(tulem, labels)
for k in out:
print(k)
for i in tulemitabel:
print(i)
else:
p = Path(args.infile)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment