[Zodb-checkins] CVS: Zope/lib/python/ZConfig - substitution.py:1.4

Chris McDonough chrism at zope.com
Sat Aug 2 02:04:05 EDT 2003


Update of /cvs-repository/Zope/lib/python/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv10833

Modified Files:
	substitution.py 
Log Message:
Fix bugs introduced by attempting to preserve case.


=== Zope/lib/python/ZConfig/substitution.py 1.3 => 1.4 ===
--- Zope/lib/python/ZConfig/substitution.py:1.3	Fri Aug  1 16:25:59 2003
+++ Zope/lib/python/ZConfig/substitution.py	Sat Aug  2 01:03:57 2003
@@ -23,7 +23,7 @@
 
 
 def substitute(s, mapping):
-    """Interpolate variables from `section` into `s`."""
+    """Interpolate variables from `mapping` into `s`."""
     if "$" in s:
         result = ''
         rest = s
@@ -50,9 +50,10 @@
 
 
 def _split(s):
-    # Return a triple:  prefix, name, suffix
+    # Return a four tuple:  prefix, name, namecase, suffix
     # - prefix is text that can be used literally in the result (may be '')
     # - name is a referenced name, or None
+    # - namecase is the name with case preserved
     # - suffix is trailling text that may contain additional references
     #   (may be '' or None)
     if "$" in s:
@@ -62,7 +63,7 @@
             raise ZConfig.SubstitutionSyntaxError(
                 "illegal lone '$' at end of source")
         if c == "$":
-            return s[:i+1], None, s[i+2:]
+            return s[:i+1], None, None, s[i+2:]
         prefix = s[:i]
         if c == "{":
             m = _name_match(s, i + 2)
@@ -83,7 +84,7 @@
             i = m.end()
         return prefix, name.lower(), name, s[i:]
     else:
-        return s, None, None
+        return s, None, None, None
 
 
 import re




More information about the Zodb-checkins mailing list