changeset 1:15b97817550a draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_fetch_busco/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author iuc
date Sun, 22 Nov 2020 12:47:50 +0000
parents 53eec20e8fb6
children 2b4526fdf7fb
files data_manager/data_manager.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager.py	Thu Oct 19 15:56:20 2017 -0400
+++ b/data_manager/data_manager.py	Sun Nov 22 12:47:50 2020 +0000
@@ -50,13 +50,15 @@
     data_manager_entry['name'] = args.name
     data_manager_entry['path'] = '.'
     data_manager_json = dict(data_tables=dict(busco=data_manager_entry))
-    params = json.loads(open(args.output).read())
+    with open(args.output) as fh:
+        params = json.load(fh)
     target_directory = params['output_data'][0]['extra_files_path']
     os.mkdir(target_directory)
     output_path = os.path.abspath(os.path.join(os.getcwd(), 'busco'))
     for filename in os.listdir(workdir):
         shutil.move(os.path.join(output_path, filename), target_directory)
-    file(args.output, 'w').write(json.dumps(data_manager_json))
+    with open(args.output, 'w') as fh:
+        json.dump(data_manager_json, fh, sort_keys=True)
 
 
 if __name__ == '__main__':