comparison data_manager/make_json.py @ 5:6f0294046f41 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken_database/ commit 8652f36a3a3838dca989426961561e81432acf4f
author iuc
date Tue, 04 Apr 2017 17:49:05 -0400
parents d5d803e654dd
children 1d616842e1db
comparison
equal deleted inserted replaced
4:1de1817a8a57 5:6f0294046f41
1 import argparse
1 import json 2 import json
2 import argparse
3 import os 3 import os
4 import shutil 4 import shutil
5 5
6 parser = argparse.ArgumentParser(description='Create data manager json.')
7 parser.add_argument('--db', dest='database', action='store', help='Database name')
8 parser.add_argument('--out', dest='output', action='store', help='JSON filename')
9
10 args = parser.parse_args()
11 6
12 def main(args): 7 def main(args):
13 data_manager_entry = {} 8 data_manager_entry = {}
14 data_manager_entry['value'] = args.database.lower() 9 data_manager_entry['value'] = args.database.lower()
15 data_manager_entry['name'] = args.database 10 data_manager_entry['name'] = args.database
21 output_path = os.path.join(os.getcwd(), 'kraken-database') 16 output_path = os.path.join(os.getcwd(), 'kraken-database')
22 for filename in os.listdir(output_path): 17 for filename in os.listdir(output_path):
23 shutil.move(os.path.join(output_path, filename), target_directory) 18 shutil.move(os.path.join(output_path, filename), target_directory)
24 file(args.output, 'w').write(json.dumps(data_manager_json)) 19 file(args.output, 'w').write(json.dumps(data_manager_json))
25 20
21
26 if __name__ == '__main__': 22 if __name__ == '__main__':
23 parser = argparse.ArgumentParser(description='Create data manager json.')
24 parser.add_argument('--db', dest='database', action='store', help='Database name')
25 parser.add_argument('--out', dest='output', action='store', help='JSON filename')
26 args = parser.parse_args()
27 main(args) 27 main(args)
28