changeset 2:ce1d5c8d5bff draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_mash_sketch_builder/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author iuc
date Sun, 22 Nov 2020 12:50:56 +0000
parents b6016642539d
children 7197573e88b9
files data_manager/mash_sketch_builder.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/mash_sketch_builder.py	Tue Apr 07 23:20:17 2020 -0400
+++ b/data_manager/mash_sketch_builder.py	Sun Nov 22 12:50:56 2020 +0000
@@ -59,7 +59,8 @@
     parser.add_argument('--sketch-name', dest='sketch_name', help='Name for sketch')
     args = parser.parse_args()
 
-    data_manager_input = json.loads(open(args.data_manager_json).read())
+    with open(args.data_manager_json) as fh:
+        data_manager_input = json.load(fh)
 
     target_directory = data_manager_input['output_data'][0]['extra_files_path']
 
@@ -88,7 +89,8 @@
         target_directory,
     )
 
-    open(args.data_manager_json, 'w').write(json.dumps(data_manager_output, sort_keys=True))
+    with open(args.data_manager_json, 'w') as fh:
+        json.dump(data_manager_output, fh, sort_keys=True)
 
 
 if __name__ == "__main__":