Skip to content
This repository
Browse code

Use urlretrieve in other instance of save to disk

  • Loading branch information...
commit 3be3913846c0314ecbe480cbf327f1ba118e25b2 1 parent 62c0db8
David Cain DavidCain authored etal committed

Showing 1 changed file with 2 additions and 4 deletions. Show diff stats Hide diff stats

  1. +2 4 Bio/PDB/PDBList.py
6 Bio/PDB/PDBList.py
@@ -293,11 +293,9 @@ def get_seqres_file(self, savefile='pdb_seqres.txt'):
293 293 """Retrieves a (big) file containing all the sequences of PDB entries
294 294 and writes it to a file.
295 295 """
296   - print "retrieving sequence file. Takes about 15 MB."
  296 + print "Retrieving sequence file (takes about 15 MB)."
297 297 url = self.pdb_server + '/pub/pdb/derived_data/pdb_seqres.txt'
298   - with contextlib.closing(_urlopen(url)) as handle:
299   - with open(savefile, 'w') as outfile:
300   - outfile.writelines(handle.readlines())
  298 + urllib.urlretrieve(url, savefile)
301 299
302 300
303 301 if __name__ == '__main__':

0 comments on commit 3be3913

Please sign in to comment.
Something went wrong with that request. Please try again.