Commit 526bc360 authored by Neeme Kahusk's avatar Neeme Kahusk

loeb zip faili

parent c8c79fa3
......@@ -3,14 +3,18 @@
"""Tabeldaja makes csv file from Meta-Share export XML
import os
import os.path
import argparse
import re
import csv
import tempfile
from zipfile import ZipFile
from pathlib import Path
from lxml import etree
import csv
from prepare import read_xml
......@@ -22,6 +26,16 @@ def get_xpath(root: etree._ElementTree, xpath: str):
return ', '.join(texts)
def zip2roots(infile: str) -> list:
olist = []
with tempfile.TemporaryDirectory() as tmpdirname:
with ZipFile(infile) as myzip:
p = Path(tmpdirname)
for child in p.iterdir():
return olist
def main():
parser = argparse.ArgumentParser(description='Avab zip faili')
......@@ -33,8 +47,10 @@ def main():
args = parser.parse_args()
with ZipFile(args.infile, 'r') as myzip:
tulem = zip2roots(args.infile)
for i in tulem:
print(etree.tounicode(i, pretty_print=True))
r = read_xml(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