# HG changeset patch # User proteore # Date 1591364993 0 # Node ID bb552aa4b9ac150931c17f1df1ed5b189b3eda52 # Parent 93bb1170280dd43e3f77675774519183074bba16 "planemo upload commit 59b014e9f6e2d668cbd7c4844b10db3d59baefd8-dirty" diff -r 93bb1170280d -r bb552aa4b9ac data_manager/resource_building.py --- 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) : diff -r 93bb1170280d -r bb552aa4b9ac data_manager/resource_building.xml --- 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 @@ - + to create or update reference files for proteore tools - python