[Zope3-checkins] CVS: Packages/ZConfig - SchemaInfo.py:1.1.2.2

Fred L. Drake, Jr. fred@zope.com
Fri, 6 Dec 2002 21:37:47 -0500


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

Modified Files:
      Tag: zconfig-schema-devel-branch
	SchemaInfo.py 
Log Message:
KeyInfo:  No data conversions should happen here.

SectionInfo.getinfo():  Get the info object for a particular name.


=== Packages/ZConfig/SchemaInfo.py 1.1.2.1 => 1.1.2.2 ===
--- Packages/ZConfig/SchemaInfo.py:1.1.2.1	Fri Dec  6 18:54:03 2002
+++ Packages/ZConfig/SchemaInfo.py	Fri Dec  6 21:37:46 2002
@@ -15,7 +15,6 @@
         self.maxOccurs = maxOccurs
         self.handler = handler
         self._default = None
-        self._converted = False
         self._finished = False
 
     def finish(self):
@@ -43,13 +42,6 @@
                              " has been completely initialized")
         if self._default is None and self.maxOccurs > 1:
             self._default = []
-            self._converted = True
-        if not self._converted:
-            if self.maxOccurs > 1:
-                self._default = map(self.datatype.convert, self._default)
-            elif self._default is not None:
-                self._default = self.datatype.convert(self._default)
-            self._converted = True
         return self._default
 
     def ismulti(self):
@@ -83,13 +75,19 @@
     def addkey(self, keyinfo):
         self._add_child(keyinfo.name, keyinfo)
 
+    def getinfo(self, name):
+        for c in self._children:
+            if c.name == name:
+                return c
+        return None
+
     def getchildnames(self):
         return [c.name for c in self._children]
 
     def issection(self):
         return True
 
-    def allowsUnnamed(self):
+    def allowUnnamed(self):
         return "*" in self.names
 
     def isAllowedName(self, name):