Mercurial > repos > proteore > proteore_data_manager
changeset 53:bb552aa4b9ac draft
"planemo upload commit 59b014e9f6e2d668cbd7c4844b10db3d59baefd8-dirty"
| author | proteore |
|---|---|
| date | Fri, 05 Jun 2020 13:49:53 +0000 |
| parents | 93bb1170280d |
| children | 109fc5236204 |
| files | data_manager/resource_building.py data_manager/resource_building.xml |
| diffstat | 2 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/data_manager/resource_building.py Fri Jun 05 13:38:12 2020 +0000 +++ b/data_manager/resource_building.py Fri Jun 05 13:49:53 2020 +0000 @@ -281,17 +281,16 @@ return (path) def id_list_from_nextprot_ftp(file,target_directory) : + ftp_dir = "pub/current_release/ac_lists/" path = os.path.join(target_directory, file) ftp = ftplib.FTP("ftp.nextprot.org") ftp.login("anonymous", "anonymous") - ftp.cwd("pub/current_release/ac_lists/") - r = StringIO() - ftp.retrlines("RETR " + file, lambda line: r.write(line + '\n')) + ftp.cwd(ftp_dir) + ftp.retrbinary("RETR " + file, open(path, 'wb').write) ftp.quit() - r.seek(0) - ids = r.readlines() - ids = [id.strip('\n') for id in ids if id != ''] - return (ids) + with open(path,'r') as nextprot_ids : + nextprot_ids = nextprot_ids.read().splitlines() + return (nextprot_ids) #return '' if there's no value in a dictionary, avoid error def access_dictionary (dico,key1,key2) :
--- a/data_manager/resource_building.xml Fri Jun 05 13:38:12 2020 +0000 +++ b/data_manager/resource_building.xml Fri Jun 05 13:49:53 2020 +0000 @@ -1,9 +1,8 @@ -<tool id="data_manager_proteore" name="Get source files for proteore tools" version="2020.06.05.1" tool_type="manage_data"> +<tool id="data_manager_proteore" name="Get source files for proteore tools" version="2020.06.05.2" tool_type="manage_data"> <description> to create or update reference files for proteore tools </description> <requirements> - <requirement type="package" version="3.8.2">python</requirement> </requirements> <stdio> <exit_code range="1:" />
