[sword-svn] r407 - trunk/modules/python
chrislit at crosswire.org
chrislit at crosswire.org
Fri Oct 12 12:23:57 MST 2012
Author: chrislit
Date: 2012-10-12 12:23:56 -0700 (Fri, 12 Oct 2012)
New Revision: 407
Modified:
trunk/modules/python/usfm2osis.py
Log:
fixed some errors pertaining to \cp & \vp
Modified: trunk/modules/python/usfm2osis.py
===================================================================
--- trunk/modules/python/usfm2osis.py 2012-10-11 17:40:18 UTC (rev 406)
+++ trunk/modules/python/usfm2osis.py 2012-10-12 19:23:56 UTC (rev 407)
@@ -628,12 +628,12 @@
ctext = matchObject.group(1)
cp = re.search(r'\\cp\s+(.+?)(?=(\\|\s))', ctext)
if cp:
- ctext = re.sub(r'\\cp\s+(.+?)\\cp*', '', ctext, flags=re.DOTALL)
+ ctext = re.sub(r'\\cp\s+(.+?)(?=(\\|\s))', '', ctext, flags=re.DOTALL)
cp = cp.group(1)
ctext = re.sub(r'"\$BOOK\$\.([^"\.]+)"', '"$BOOK$.'+cp+'"', ctext)
ca = re.search(r'\\ca\s+(.+?)\\ca\*', ctext)
if ca:
- ctext = re.sub(r'\\ca\s+(.+?)\\ca*', '', ctext, flags=re.DOTALL)
+ ctext = re.sub(r'\\ca\s+(.+?)\\ca\*', '', ctext, flags=re.DOTALL)
ca = ca.group(1)
ctext = re.sub(r'(osisID="\$BOOK\$\.[^"\.]+)"', r'\1 $BOOK$.'+ca+'"', ctext)
return ctext
@@ -658,14 +658,14 @@
"""
vtext = matchObject.group(1)
- vp = re.search(r'\\vp\s+(.+?)\\vp*', vtext)
+ vp = re.search(r'\\vp\s+(.+?)\\vp\*', vtext)
if vp:
- vtext = re.sub(r'\\vp\s+(.+?)\\vp*', '', vtext, flags=re.DOTALL)
+ vtext = re.sub(r'\\vp\s+(.+?)\\vp\*', '', vtext, flags=re.DOTALL)
vp = vp.group(1)
- vtext = re.sub(r'"\$BOOK\$\.\$CHAP\$\.([^"\.]+)"', '"$BOOK$.$CHAP$.'+va+'"', vtext)
+ vtext = re.sub(r'"\$BOOK\$\.\$CHAP\$\.([^"\.]+)"', '"$BOOK$.$CHAP$.'+vp+'"', vtext)
va = re.search(r'\\va\s+(.+?)\\va\*', vtext)
if va:
- vtext = re.sub(r'\\va\s+(.+?)\\va*', '', vtext, flags=re.DOTALL)
+ vtext = re.sub(r'\\va\s+(.+?)\\va\*', '', vtext, flags=re.DOTALL)
va = va.group(1)
vtext = re.sub(r'(osisID="\$BOOK\$\.\$CHAP\$\.[^"\.]+)"', r'\1 $BOOK$.$CHAP$.'+va+'"', vtext)
return vtext
More information about the sword-cvs
mailing list