changeset 7:3e4d45aca422 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_sam_fasta_index_builder commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author iuc
date Sun, 22 Nov 2020 12:53:26 +0000
parents f8418a1bf7d0
children 3ec5c51384e6
files data_manager/data_manager_sam_fasta_index_builder.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_sam_fasta_index_builder.py	Thu Nov 28 15:48:23 2019 -0500
+++ b/data_manager/data_manager_sam_fasta_index_builder.py	Sun Nov 22 12:53:26 2020 +0000
@@ -71,7 +71,8 @@
 
     filename = args[0]
 
-    params = json.loads(open(filename).read())
+    with open(filename) as fh:
+        params = json.load(fh)
     target_directory = params['output_data'][0]['extra_files_path']
     os.mkdir(target_directory)
     data_manager_dict = {}
@@ -93,7 +94,8 @@
     )
 
     # save info to json file
-    open(filename, 'w').write(json.dumps(data_manager_dict, sort_keys=True))
+    with open(filename, 'w') as fh:
+        json.dump(data_manager_dict, fh, sort_keys=True)
 
 
 if __name__ == "__main__":