[Zodb-checkins] CVS: Packages/ZConfig - info.py:1.1.2.6 matcher.py:1.1.2.11 schema.py:1.1.2.7

Fred L. Drake, Jr. fred@zope.com
Thu, 12 Dec 2002 00:03:09 -0500


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

Modified Files:
      Tag: zconfig-schema-devel-branch
	info.py matcher.py schema.py 
Log Message:
Make sure the datatype for the complete schema is passed through where needed
and applied at the end.


=== Packages/ZConfig/info.py 1.1.2.5 => 1.1.2.6 ===
--- Packages/ZConfig/info.py:1.1.2.5	Wed Dec 11 15:18:15 2002
+++ Packages/ZConfig/info.py	Thu Dec 12 00:03:08 2002
@@ -222,8 +222,8 @@
 
 
 class SchemaInfo(SectionInfo):
-    def __init__(self, handler, keytype):
-        SectionInfo.__init__(self, None, None, 1, 1, handler, None,
+    def __init__(self, datatype, handler, keytype):
+        SectionInfo.__init__(self, None, datatype, 1, 1, handler, None,
                              keytype, (), None)
 
     def allowUnnamed(self):


=== Packages/ZConfig/matcher.py 1.1.2.10 => 1.1.2.11 ===
--- Packages/ZConfig/matcher.py:1.1.2.10	Wed Dec 11 22:09:59 2002
+++ Packages/ZConfig/matcher.py	Thu Dec 12 00:03:08 2002
@@ -138,6 +138,12 @@
     def __init__(self, info):
         SectionMatcher.__init__(self, info, None)
 
+    def finish(self):
+        # Since there's no outer container to call datatype.convert()
+        # for the schema, we convert on the way out.
+        v = SectionMatcher.finish(self)
+        return self.info.datatype.convert(v)
+
 
 class SectionValue:
     """Generic 'bag-of-values' object for a section."""


=== Packages/ZConfig/schema.py 1.1.2.6 => 1.1.2.7 ===
--- Packages/ZConfig/schema.py:1.1.2.6	Wed Dec 11 22:12:23 2002
+++ Packages/ZConfig/schema.py	Thu Dec 12 00:03:08 2002
@@ -123,7 +123,10 @@
             keytype = datatypes.get(attrs["keytype"])
         else:
             keytype = default_key_type
-        self._schema = info.SchemaInfo(handler, keytype)
+        datatype = attrs.get("type")
+        if datatype:
+            datatype = datatypes.get(self.get_classname(datatype))
+        self._schema = info.SchemaInfo(datatype, handler, keytype)
         self._sections = [self._schema]
         self._stack = [self._schema]