# HG changeset patch # User siwaa # Date 1708010693 0 # Node ID aa5c088856c82d01480ad658c4e9673478892167 # Parent 9e8f5f220917318d114466c39611a0659e680622 planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 490623122691651ac91c33d75ea1898189be7512-dirty diff -r 9e8f5f220917 -r aa5c088856c8 main_file.py --- a/main_file.py Thu Feb 15 14:44:47 2024 +0000 +++ b/main_file.py Thu Feb 15 15:24:53 2024 +0000 @@ -58,6 +58,10 @@ data = dict() json_response = dict() +# default configuration + maybe some modifications +config = erecord_api.conf() # default (vle-2.0.0 version) +config.DB_add_vpz(vpz_id=1312, vpzname="wwdm.vpz", pkgname="wwdm") + try : parser = argparse.ArgumentParser() @@ -110,9 +114,7 @@ r["data"] = data - # default configuration + maybe some modifications - config = erecord_api.conf() # default (vle-2.0.0 version) - config.DB_add_vpz(vpz_id=1312, vpzname="wwdm.vpz", pkgname="wwdm") + # configuration if MAIN_DEBUG: r["config"] = config.get_as_dict() # debug r_init = erecord_api.init(config) @@ -155,8 +157,12 @@ r["response"] = json_response -# Restitution : json file -jsonoutput_filepath = os.path.join(config.out_path, config.jsonoutput_filename) -with open(jsonoutput_filepath, "w") as outfile: - json.dump(r, outfile) +try : + # Restitution : json file + jsonoutput_filepath = os.path.join(config.out_path, + config.jsonoutput_filename) + with open(jsonoutput_filepath, "w") as outfile: + json.dump(r, outfile) +except : + print(PM, " -- error when trying to open output json file --")