changeset 1:83f07f40b200 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_metaphlan2_database_downloader commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author iuc
date Sun, 22 Nov 2020 12:51:11 +0000
parents 9c4ad82be5bd
children
files data_manager/data_manager_metaphlan2_download.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_metaphlan2_download.py	Sat Mar 04 12:11:20 2017 -0500
+++ b/data_manager/data_manager_metaphlan2_download.py	Sun Nov 22 12:51:11 2020 +0000
@@ -24,7 +24,8 @@
     to create it if necessary.
 
     """
-    params = json.loads(open(jsonfile).read())
+    with open(jsonfile) as fh:
+        params = json.load(fh)
     return (params['param_dict'],
             params['output_data'][0]['extra_files_path'])
 
@@ -36,7 +37,7 @@
 # >>> add_data_table(d,'my_data')
 # >>> add_data_table_entry(dict(dbkey='hg19',value='human'))
 # >>> add_data_table_entry(dict(dbkey='mm9',value='mouse'))
-# >>> print str(json.dumps(d))
+# >>> print(json.dumps(d))
 def create_data_tables_dict():
     """Return a dictionary for storing data table information
 
@@ -144,7 +145,6 @@
 
     # Write output JSON
     print("Outputting JSON")
-    print(str(json.dumps(data_tables)))
-    with open(jsonfile, 'wb') as out:
-        out.write(json.dumps(data_tables))
+    with open(jsonfile, 'w') as fh:
+        json.dump(data_tables, fh, sort_keys=True)
     print("Done.")