From 154d12031a3d24c76f67160702a301cffd32bac3 Mon Sep 17 00:00:00 2001 From: luclaurent Date: Thu, 15 Feb 2024 08:26:10 +0100 Subject: [PATCH] update use-case --- examples/use-cases/run.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/use-cases/run.py b/examples/use-cases/run.py index 43c5265..215d26d 100644 --- a/examples/use-cases/run.py +++ b/examples/use-cases/run.py @@ -121,7 +121,7 @@ idHal = execHAL.runJSON2HAL( json_file, verbose=True, - prod="prod", + prod="test", # switch to prod with caution credentials=misc.load_credentials(),# completion="idext,affiliation", # or false idhal=None, @@ -138,8 +138,9 @@ # add pdf to HAL if True: - import glob + import glob,shutil jsondir = 'json' + pathlib.Path(os.path.join(saveDir,"done")).mkdir(parents=True, exist_ok=True) for file in glob.glob(os.path.join(jsondir, "*.json")): data = json.loads(open(file).read()) # add pdf @@ -147,11 +148,13 @@ execHAL.runPDF2HAL( os.path.join(jsondir,data.get("fileTmp")), verbose=True, - prod="test", + prod="prod", credentials=misc.load_credentials(), completion=None, halid=data.get("doc_idhal"), idhal=None, interaction=False) + # move to done + shutil.move(file,os.path.join(jsondir,"done",os.path.basename(file)))