[pybliographer-1.2.6.2] bug in isifile.py

Pavol Juhas <[email protected]>
Newsgroups gmane.comp.gnome.apps.pybliographer
Message-ID <[email protected]>
Hello,

I was trying to use pybliographer 1.2.6.2 with larger
ISI files, but it did not work as it was crashing during bibopen 
with "index out of range" error.  I was able to track the problem to 
isifile.py, and the attached patch should fix it.  Let me know if 
there has already been some other solution in development versions.

Cheers,

Pavol
isifile.patch (text/plain, 803 B)
diff -ur --exclude='*.pyc' pybliographer/Pyblio/Format/isifile.py /u24/local/share/pybliographer/Pyblio/Format/isifile.py
--- pybliographer/Pyblio/Format/isifile.py	2005-05-17 02:16:29.000000000 -0400
+++ /u24/local/share/pybliographer/Pyblio/Format/isifile.py	2005-05-18 16:58:45.000000000 -0400
@@ -208,6 +208,9 @@
             if lines.has_key('JI'):
                 uc_title = re.split(r"([- .,/]+)", uc_title)
                 ca_title = re.split(r"[- .,/]+", ' '.join(lines['JI']))
+                # make sure ca_title is not shorter than uc_title
+                if len(ca_title) < len(uc_title):
+                    ca_title += [''] * (len(uc_title)-len(ca_title))
                 i , Title = 0, []
                 for word in uc_title:
                     Word = string.capitalize(word)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.