[BioPython] bug: PDB.PDBList module "get_recent_filenames"
Long Li
longlill at yahoo.com
Wed Sep 15 10:15:17 EDT 2004
In PDB.PDBList module, the method
"get_recent_filenames" of the class "PDBList" has a
bug.
____________________________________________________
def get_recent_filenames(self):
...
...
file = url.readlines()
maxdate = 0
for l in file:
try:
# check if this is a valid date
date = int(l[54:62])
if date > maxdate: maxdate = date
except:
pass
...
...
_____________________________________________________
The statement "date = int(l[54:62])" should be changed
to "date = int( l[ 45:53 ] )".
After I try the statement "file = url.readlines()" in
the code above, it output like this:
drwxrwxr-x 2 702 512 Aug 30 19:22 20040830
drwxrwxr-x 2 702 512 Sep 3 16:06 20040903
drwxrwxr-x 2 702 512 Sep 13 17:03 20040913
-rw-r--r-- 1 702 1218 Nov 26 2003 README
not like that described in the module:
drwxrwxr-x 2 1002 sysadmin 512 Oct 6 18:28
20031006
drwxrwxr-x 2 1002 sysadmin 512 Oct 14 02:14
20031013
-rw-r--r-- 1 1002 sysadmin 1327 Mar 12 2001
README
I think it is not a good way to get the directory name
by using the slice of result of "readlines()", could
the directory name be read directly?
Best regards,
Long
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the BioPython
mailing list