Added multi file reading

This commit is contained in:
Luka 2020-07-20 15:52:01 +02:00
parent eb86a6bb1c
commit 14951e8422
2 changed files with 14 additions and 1 deletions

View File

@ -9,3 +9,12 @@ Potrebne datoteke:
Priporocam: pypy3 paket za hitrejse poganjanje.
Primer uporabe: `python3 wani.py ssj500k.xml Kolokacije_strukture.xml izhod.csv`
## Instructions for running on GF
Suggested running with saved mysql file in tmpfs. Instructions:
```bash
sudo mkdir /mnt/tmp
sudo mount -t tmpfs tmpfs /mnt/tmp
```

View File

@ -1,3 +1,4 @@
import os
from xml.etree import ElementTree
import logging
import re
@ -18,6 +19,9 @@ def load_files(args, database):
skip_id_check = args.skip_id_check
do_msd_translate = not args.no_msd_translate
if len(filenames) == 1 and os.path.isdir(filenames[0]):
filenames = [os.path.join(filenames[0], file) for file in os.listdir(filenames[0])]
database.init("CREATE TABLE Files ( filename varchar(2048) )")
for idx, fname in enumerate(filenames):