From 0fd857051edd836ce30133a5399c8ed058ac698d Mon Sep 17 00:00:00 2001 From: Karim Ahmed <karim.ahmed@xfel.eu> Date: Tue, 7 Jan 2020 17:46:10 +0100 Subject: [PATCH] change args out-folder with out-path --- xfel_calibrate/calibrate.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py index 02be5c08e..0bed5ab99 100755 --- a/xfel_calibrate/calibrate.py +++ b/xfel_calibrate/calibrate.py @@ -769,17 +769,12 @@ def run(): caltype.upper(), datetime.now().isoformat()) if try_report_to_output: if "out_folder" in args: - out_path = os.path.abspath(args["out_folder"]) - if "run" in args: + if "run" in args and str(args["run"]) not in args["out_folder"]: rr = args["run"] - # Only put run, when it is not in the folder path - # (e.g. out-folder from webservice conf) - if "r{:04d}/".format(rr) not in out_path and\ - "{}".format(rr) not in out_path: - if isinstance(rr, int): - out_path = "{}/r{:04d}/".format(out_path, rr) - else: - out_path = "{}/{}/".format(out_path, rr) + # Only put run, when it is not in the out_folder + if isinstance(rr, int): + args["out_folder"] = "{}/{}/".format(args["out_folder"], rr) + out_path = os.path.abspath(args["out_folder"]) else: print("No 'out_folder' defined as argument, outputting to '{}' instead.".format( out_path)) -- GitLab