Repository 'data_manager_twobit_builder'
hg clone https://toolshed.g2.bx.psu.edu/repos/devteam/data_manager_twobit_builder

Changeset 5:625fd9476402 (2020-11-22)
Previous changeset 4:16c0c73b28ad (2019-11-28) Next changeset 6:62359a151521 (2023-04-16)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_twobit_builder commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
modified:
data_manager/twobit_builder.py
b
diff -r 16c0c73b28ad -r 625fd9476402 data_manager/twobit_builder.py
--- a/data_manager/twobit_builder.py Thu Nov 28 15:49:13 2019 -0500
+++ b/data_manager/twobit_builder.py Sun Nov 22 12:54:42 2020 +0000
[
@@ -2,12 +2,12 @@
 # Dan Blankenberg
 from __future__ import print_function
 
+import json
 import optparse
 import os
 import subprocess
 import sys
 import tempfile
-from json import dumps, loads
 
 CHUNK_SIZE = 2**20  # 1mb
 
@@ -75,7 +75,8 @@
 
     filename = args[0]
 
-    params = 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)
@@ -92,7 +93,8 @@
     build_twobit(data_manager_dict, options.fasta_filename, params, target_directory, dbkey, sequence_id, sequence_name)
 
     # save info to json file
-    open(filename, 'w').write(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__":