changeset 4:d58cad5baa70 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_fetch_refseq commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author iuc
date Sun, 22 Nov 2020 12:49:04 +0000
parents f1e545aa76c7
children
files data_manager/fetch_refseq.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/fetch_refseq.py	Sun Apr 19 14:44:09 2020 -0400
+++ b/data_manager/fetch_refseq.py	Sun Nov 22 12:49:04 2020 +0000
@@ -141,7 +141,8 @@
     division_names = args.division_names.split(',')
     mol_types = args.mol_types.split(',')
     if args.galaxy_datamanager_filename is not None:
-        dm_opts = json.loads(open(args.galaxy_datamanager_filename).read())
+        with open(args.galaxy_datamanager_filename) as fh:
+            dm_opts = json.load(fh)
         output_directory = dm_opts['output_data'][0]['extra_files_path']  # take the extra_files_path of the first output parameter
         data_manager_dict = {}
     else:
@@ -162,4 +163,5 @@
                 _add_data_table_entry(data_manager_dict=data_manager_dict,
                                       data_table_entry=dict(value=unique_key, dbkey=dbkey, name=desc, path=path),
                                       data_table_name='all_fasta')
-            open(args.galaxy_datamanager_filename, 'w').write(json.dumps(data_manager_dict, sort_keys=True))
+            with open(args.galaxy_datamanager_filename, 'w') as fh:
+                json.dump(data_manager_dict, fh, sort_keys=True)