Mercurial > repos > iuc > data_manager_build_bracken_database
changeset 2:fd5830f88314 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author | iuc |
---|---|
date | Sun, 22 Nov 2020 12:45:23 +0000 |
parents | 9059edc96a85 |
children | 3c7d2c84cb09 |
files | data_manager/bracken_build_database.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/data_manager/bracken_build_database.py Sun Jan 19 04:33:53 2020 -0500 +++ b/data_manager/bracken_build_database.py Sun Nov 22 12:45:23 2020 +0000 @@ -55,7 +55,8 @@ parser.add_argument('--database-name', dest='database_name', help='Database Name') 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'] @@ -69,7 +70,7 @@ try: os.mkdir(target_directory) except OSError as exc: - if exc.errno == errno.EEXIST and os.path.isdir( target_directory ): + if exc.errno == errno.EEXIST and os.path.isdir(target_directory): pass else: raise @@ -82,8 +83,8 @@ args.database_name, ) - with open(args.data_manager_json, 'w') as out: - out.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__":