From f6e63d3d53a3f4c03c646ccadf718920a0a1095e Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 27 Mar 2026 13:15:58 +0100 Subject: Make sure paths are available --- more_functions.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'more_functions.py') diff --git a/more_functions.py b/more_functions.py index 8162acc..7f12215 100755 --- a/more_functions.py +++ b/more_functions.py @@ -175,5 +175,12 @@ def searchArchived(sets, query, filetype,sents, path_user): gwas_json+="{ \"id\": \"" + edgeID + "\", \"source\": \"" + query + "\", \"target\": \"" + key + "\", \"sentCnt\": \"" + str(catCnt[key]) + "\", \"url\":\"/sentences?edgeID=" + edgeID + "\" },\n" return(nodes+edges,gwas_json,sn_file) -pubmed_path=os.environ["EDIRECT_PUBMED_MASTER"] +pubmed_path=os.environ.get("EDIRECT_PUBMED_MASTER", "./minipubmed") + +if not os.path.isdir(pubmed_path): + print(f"ERROR: EDIRECT_PUBMED_MASTER directory not found: {pubmed_path}") + raise SystemExit(1) +if not os.path.isdir(os.path.join(pubmed_path, "PubMed", "Archive")): + print(f"ERROR: PubMed/Archive not found in {pubmed_path}") + raise SystemExit(1) -- cgit 1.4.1