[Zope3-checkins] CVS: Packages/ZConfig - matcher.py:1.1.2.18

Fred L. Drake, Jr. fred@zope.com
Fri, 13 Dec 2002 10:41:53 -0500


Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv553

Modified Files:
      Tag: zconfig-schema-devel-branch
	matcher.py 
Log Message:
When constructing the value for a section, *always* get the datatype
from the value's __type__, since ci.datatype isn't always right for
section groups.


=== Packages/ZConfig/matcher.py 1.1.2.17 => 1.1.2.18 ===
--- Packages/ZConfig/matcher.py:1.1.2.17	Fri Dec 13 09:53:47 2002
+++ Packages/ZConfig/matcher.py	Fri Dec 13 10:41:52 2002
@@ -124,11 +124,16 @@
         values = self._values
         for i in range(len(values)):
             name, ci = self.type[i]
-            dt = ci.datatype
             if ci.ismulti():
-                values[i] = [dt.convert(s) for s in values[i]]
+                if ci.issection():
+                    values[i] = [s.__type__.datatype.convert(s)
+                                 for s in values[i]]
+                else:
+                    values[i] = [ci.datatype.convert(s) for s in values[i]]
+            elif ci.issection():
+                values[i] = values[i].__type__.datatype.convert(values[i])
             else:
-                values[i] = dt.convert(values[i])
+                values[i] = ci.datatype.convert(values[i])
         v = self.createValue(attrnames)
         # XXX  Really should delay this until after all the
         # XXX  sibling SectionValue instances have been created and