# HG changeset patch # User matthias # Date 1541097623 14400 # Node ID f7ad11d3109839fa2190d3638b42a872115f7ff4 # Parent 1f839ba466daada64f01fb38221831e225985e7a planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tree/master/data_managers/data_manager_megan_tools commit 0e93d2fb8e3c10949811b19ec3329bd1abbb73bf-dirty diff -r 1f839ba466da -r f7ad11d31098 data_manager/.data_manager.py.swp Binary file data_manager/.data_manager.py.swp has changed diff -r 1f839ba466da -r f7ad11d31098 data_manager/data_manager.py --- a/data_manager/data_manager.py Thu Nov 01 12:25:53 2018 -0400 +++ b/data_manager/data_manager.py Thu Nov 01 14:40:23 2018 -0400 @@ -47,7 +47,15 @@ } def url_download(fname, workdir): - file_path = os.path.join(workdir, 'download.dat') + """ + download http://ab.inf.uni-tuebingen.de/data/software/megan6/download/FNAME + to workdir + and unzip zip file (not gz) + + return the name of the resulting file + ie gz-file of extracted file in zip-file + """ + file_path = os.path.join(workdir, fname) if not os.path.exists(workdir): os.makedirs(workdir) src = None @@ -68,20 +76,22 @@ if zipfile.is_zipfile(file_path): fh = zipfile.ZipFile(file_path, 'r') else: - return + return fname fh.extractall(workdir) os.remove(file_path) - + unzipped = os.listdir(workdir) + assert len(unzipped) == 1 + return unzipped[0] def main(fname, outjson): workdir = os.path.join(os.getcwd(), 'megan_tools') - url_download(fname, workdir) + path = url_download(fname, workdir) data_manager_entry = {} data_manager_entry['value'] = fname.split(".")[0] data_manager_entry['name'] = FILE2NAME[fname] data_manager_entry['type'] = FILE2TYPE[fname] - data_manager_entry['path'] = '.' + data_manager_entry['path'] = path data_manager_json = dict(data_tables=dict(megan_tools=data_manager_entry))