[svn-commits] kmoore: testsuite/asterisk/trunk r3455 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 5 08:19:04 CDT 2012


Author: kmoore
Date: Wed Sep  5 08:19:00 2012
New Revision: 3455

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3455
Log:
Ensure the config parser is flexible enough to handle most configs

The configuration parser was still throwing errors on some valid config
lines after the last tweak. This change adds "<>:" as valid characters
and allows empty-value config lines.

Modified:
    asterisk/trunk/lib/python/asterisk/config.py

Modified: asterisk/trunk/lib/python/asterisk/config.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/config.py?view=diff&rev=3455&r1=3454&r2=3455
==============================================================================
--- asterisk/trunk/lib/python/asterisk/config.py (original)
+++ asterisk/trunk/lib/python/asterisk/config.py Wed Sep  5 08:19:00 2012
@@ -40,11 +40,11 @@
         self.name = name
         self.template = template
         self.varval_re = re.compile("""
-            \s*                             # Leading whitespace
-            (?P<name>[\w|,\.-]+)            # Option name
-            \s*=>?\s*                       # Separator, = or =>
-            (?P<value>[\w\s=_()/@|,'"\.-]+) # Option value
-            (?:;.*)?$                       # Optional comment before end of line
+            \s*                                # Leading whitespace
+            (?P<name>[\w|,\.-]+)               # Option name
+            \s*=>?\s*                          # Separator, = or =>
+            (?P<value>[\w\s=_()/@|,'"\.<>:-]*) # Option value (can be zero-length)
+            (?:;.*)?$                          # Optional comment before end of line
             """, re.VERBOSE)
 
     def parse_line(self, line):




More information about the svn-commits mailing list