[sword-svn] r443 - trunk/versification

chrislit at crosswire.org chrislit at crosswire.org
Wed Jul 24 01:15:38 MST 2013


Author: chrislit
Date: 2013-07-24 01:15:38 -0700 (Wed, 24 Jul 2013)
New Revision: 443

Modified:
   trunk/versification/validate_v11n.py
Log:
bug fixes (wrong comment symbol used; failed to reset counts for each file)


Modified: trunk/versification/validate_v11n.py
===================================================================
--- trunk/versification/validate_v11n.py	2013-07-24 08:14:28 UTC (rev 442)
+++ trunk/versification/validate_v11n.py	2013-07-24 08:15:38 UTC (rev 443)
@@ -8,12 +8,12 @@
     print 'Usage: ' + sys.argv[0] + ' <canon.h-style file(s)>'
     exit()
 
-booksChapters = 0
-vmChapters = 0
-
 for fn in files:
     f = open(fn).readlines()
 
+    booksChapters = 0
+    vmChapters = 0
+
     inBooks = False
     inVm = False
 
@@ -23,7 +23,7 @@
         # [on]tbooks[]. In general, it assumes canon files that look like what
         # we include in the library and generate from v11nsys.pl.
 
-        l = re.sub(r'#.*', '', l)
+        l = re.sub(r'//.*', '', l)
         l = re.sub(r'\s*$', '', l)
         
         if l:        
@@ -42,4 +42,4 @@
                 match = re.findall(r'\d+,?', l)
                 vmChapters += len(match)
                 
-    print fn + ' is ' + ('' if booksChapters == vmChapters else 'not ') + 'valid: ' + str(booksChapters) + ':' + str(vmChapters) +'\n'
+    print fn + ' is ' + ('' if booksChapters == vmChapters else 'not ') + 'valid: ' + str(booksChapters) + ':' + str(vmChapters)




More information about the sword-cvs mailing list