From 17cb0677a7ad59ad24a6a1acc0a2ee74682158c5 Mon Sep 17 00:00:00 2001 From: voje Date: Thu, 28 Feb 2019 10:34:12 +0100 Subject: [PATCH] added logging; paralelize the first part now --- tools/gen_json.py | 5 +++-- tools/parse_all.py | 4 ++-- tools/tools.cfg | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/gen_json.py b/tools/gen_json.py index 5475f67..ad6aa30 100644 --- a/tools/gen_json.py +++ b/tools/gen_json.py @@ -11,10 +11,11 @@ config.read("tools.cfg") ORIGPATH = Path(config["tools"]["kres_orig"]) INPATH = Path(config["tools"]["kres_srl"]) OUTPATH = Path(config["tools"]["kres_json"]) -LOGFILE = Path(config["tools"]["logfile"]) DEBUG = config["tools"]["debug"] == "True" +LOGFILE = Path(config["tools"]["logfile"]).absolute().resolve() + +logging.basicConfig(filename=str(LOGFILE), level=logging.INFO) -logging.basicConfig(filename=LOGFILE, level=logging.INFO) def get_origfile(filename): for origfile in ORIGPATH.iterdir(): diff --git a/tools/parse_all.py b/tools/parse_all.py index 1218b67..82f414b 100644 --- a/tools/parse_all.py +++ b/tools/parse_all.py @@ -16,9 +16,9 @@ config = configparser.ConfigParser() config.read("tools.cfg") INDIR = Path(config["tools"]["kres_orig"]) OUTDIR = Path(config["tools"]["kres_tsv"]) -LOGFILE = Path(config["tools"]["logfile"]) +LOGFILE = Path(config["tools"]["logfile"]).absolute().resolve() -logging.basicConfig(filename=LOGFILE, level=logging.INFO) +logging.basicConfig(filename=str(LOGFILE), level=logging.INFO) """ print("parsing ssj") diff --git a/tools/tools.cfg b/tools/tools.cfg index d684723..6ae9dab 100644 --- a/tools/tools.cfg +++ b/tools/tools.cfg @@ -3,5 +3,5 @@ kres_orig = /kres_mount/kres_parsed/tei kres_tsv = ../data/kres_out/1_tsv kres_srl = ../data/kres_out/_srl kres_json = ../data/kres_out/final_json -logfile = "../progress.log" +logfile = ../progress.log debug = False