changeset 8:52b6a4d98009 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_gemini_database_downloader commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author iuc
date Sun, 22 Nov 2020 12:49:35 +0000
parents 5bcf0e24f42c
children 27a6a256cd23
files data_manager/data_manager_gemini_download.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_gemini_download.py	Thu May 14 05:08:26 2020 -0400
+++ b/data_manager/data_manager_gemini_download.py	Sun Nov 22 12:49:35 2020 +0000
@@ -16,7 +16,8 @@
 
 def main():
     today = datetime.date.today()
-    params = json.loads(open(sys.argv[1]).read())
+    with open(sys.argv[1]) as fh:
+        params = json.load(fh)
     target_directory = params['output_data'][0]['extra_files_path']
     os.mkdir(target_directory)
 
@@ -83,8 +84,8 @@
     }
 
     # ... and save it to the json results file
-    with open(sys.argv[1], 'w') as out:
-        out.write(json.dumps(data_manager_dict))
+    with open(sys.argv[1], 'w') as fh:
+        json.dump(data_manager_dict, fh, sort_keys=True)
 
 
 if __name__ == "__main__":