Permalink
Browse files

Use urlretrieve in other instance of save to disk

  • Loading branch information...
1 parent 62c0db8 commit 3be3913846c0314ecbe480cbf327f1ba118e25b2 @DavidCain DavidCain committed with etal Jan 9, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 Bio/PDB/PDBList.py
View
6 Bio/PDB/PDBList.py
@@ -293,11 +293,9 @@ def get_seqres_file(self, savefile='pdb_seqres.txt'):
"""Retrieves a (big) file containing all the sequences of PDB entries
and writes it to a file.
"""
- print "retrieving sequence file. Takes about 15 MB."
+ print "Retrieving sequence file (takes about 15 MB)."
url = self.pdb_server + '/pub/pdb/derived_data/pdb_seqres.txt'
- with contextlib.closing(_urlopen(url)) as handle:
- with open(savefile, 'w') as outfile:
- outfile.writelines(handle.readlines())
+ urllib.urlretrieve(url, savefile)
if __name__ == '__main__':

0 comments on commit 3be3913

Please sign in to comment.