[Zope-Checkins] CVS: Packages/ZConfig - matcher.py:1.1.2.22

Fred L. Drake, Jr. fred@zope.com
Fri, 13 Dec 2002 16:06:46 -0500


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

Modified Files:
      Tag: zconfig-schema-devel-branch
	matcher.py 
Log Message:
Make sure all the handlers are added, not just handlers for sections.
Remove obsolete comments about when handlers should be called; we've
already fixed that.


=== Packages/ZConfig/matcher.py 1.1.2.21 => 1.1.2.22 ===
--- Packages/ZConfig/matcher.py:1.1.2.21	Fri Dec 13 15:38:57 2002
+++ Packages/ZConfig/matcher.py	Fri Dec 13 16:06:46 2002
@@ -137,13 +137,9 @@
                 values[i] = values[i].__type__.datatype(values[i])
             else:
                 values[i] = ci.datatype(values[i])
-        v = self.createValue(attrnames)
-        # XXX  Really should delay this until after all the
-        # XXX  sibling SectionValue instances have been created and
-        # XXX  we're ready to construct the parent.
-        if self.info.handler is not None:
-            self._handlers.append((self.info.handler, v))
-        return v
+            if ci.handler is not None:
+                self._handlers.append((ci.handler, values[i]))
+        return self.createValue(attrnames)
 
     def createValue(self, attrnames):
         return SectionValue(attrnames, self._values, None, self.type)
@@ -170,7 +166,10 @@
         # Since there's no outer container to call datatype()
         # for the schema, we convert on the way out.
         v = BaseMatcher.finish(self)
-        return self.type.datatype(v)
+        v = self.type.datatype(v)
+        if self.type.handler is not None:
+            self._handlers.append((self.type.handler, v))
+        return v
 
 
 class SectionValue: