Author: sebastien.lelong
Date: Thu Sep  4 05:15:39 2008
New Revision: 267

Modified:
    trunk/tools/jsg_validator.py

Log:
fix skip free text in comment + silent modif for future use in jalapi.py

Modified: trunk/tools/jsg_validator.py
==============================================================================
--- trunk/tools/jsg_validator.py        (original)
+++ trunk/tools/jsg_validator.py        Thu Sep  4 05:15:39 2008
@@ -20,6 +20,7 @@
  # Notes:
  #

+import sys,os
  import re

  errors = []
@@ -90,6 +91,7 @@
                
        # eat header, and check fields (mandatory or not) and
        # content (using predicate)
+       c = None
        for i,l in data:
                if re.match(syntax,l):
                        # got it, check field content
@@ -105,6 +107,8 @@
        else:
                if mandatory:
                        errors.append("Cannot find field %s (searched for 
'%s')" %  
(field,syntax))
+       
+       return c


  def validate_header(content):
@@ -155,6 +159,9 @@
                        # dirty search comments...
                        if c in l:
                                l = l[:l.index(c)]
+                       tmp = [w.startswith(c) for n,w in enumerate(l)]
+                       if True in tmp:
+                               l = l[:tmp.index(True)]
                        return l
                # first check ";" *then* "--"
                # so things like ";;;;-- Note" are not considered
@@ -226,7 +233,6 @@


  if __name__ == '__main__':
-       import sys,os
        try:
                filename = sys.argv[1]
                validate(filename)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to