[sword-svn] r384 - trunk/modules/python

chrislit at crosswire.org chrislit at crosswire.org
Sun Aug 12 11:38:29 MST 2012


Author: chrislit
Date: 2012-08-12 11:38:29 -0700 (Sun, 12 Aug 2012)
New Revision: 384

Modified:
   trunk/modules/python/usfm2osis.py
Log:
On second thought, this is clearly a source encoding error and should not fail so gracefully. Descending verse ranges should produce invalid XML.


Modified: trunk/modules/python/usfm2osis.py
===================================================================
--- trunk/modules/python/usfm2osis.py	2012-08-12 18:32:31 UTC (rev 383)
+++ trunk/modules/python/usfm2osis.py	2012-08-12 18:38:29 UTC (rev 384)
@@ -1004,7 +1004,7 @@
         def expandRange(vRange):
             vRange = re.findall(r'\d+', vRange)
             osisID = list()
-            for n in range(int(vRange[0]), max(int(vRange[0]), int(vRange[1]))+1):
+            for n in range(int(vRange[0]), int(vRange[1])+1):
                 osisID.append('$BOOK$.$CHAP$.'+str(n))
             return ' '.join(osisID)
         osis = re.sub(r'\$BOOK\$\.\$CHAP\$\.(\d+-\d+)"', lambda m: expandRange(m.group(1))+'"', osis)




More information about the sword-cvs mailing list