Skip to content

Commit

Permalink
update use-case
Browse files Browse the repository at this point in the history
  • Loading branch information
luclaurent committed Feb 15, 2024
1 parent f88660a commit 154d120
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/use-cases/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -138,20 +138,23 @@

# 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
if data.get("doc_idhal") and data.get("fileTmp"):
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)))


0 comments on commit 154d120

Please sign in to comment.