[Zope3-checkins] CVS: Zope3/src/ZConfig - info.py:1.9.6.1 matcher.py:1.6.4.1 url.py:1.5.4.1

Sidnei da Silva sidnei@x3ng.com.br
Tue, 11 Feb 2003 09:41:49 -0500


Update of /cvs-repository/Zope3/src/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv18615/src/ZConfig

Modified Files:
      Tag: paris-copypasterename-branch
	info.py matcher.py url.py 
Log Message:
Updating from HEAD to make sure everything still works before merging

=== Zope3/src/ZConfig/info.py 1.9 => 1.9.6.1 ===
--- Zope3/src/ZConfig/info.py:1.9	Fri Jan 10 15:37:49 2003
+++ Zope3/src/ZConfig/info.py	Tue Feb 11 09:40:46 2003
@@ -205,11 +205,12 @@
 
 class AbstractType:
     __metaclass__ = type
-    __slots__ = '_subtypes', 'name'
+    __slots__ = '_subtypes', 'name', 'description'
 
     def __init__(self, name):
         self._subtypes = {}
         self.name = name
+        self.description = None
 
     def addsubtype(self, type):
         self._subtypes[type.name] = type


=== Zope3/src/ZConfig/matcher.py 1.6 => 1.6.4.1 ===
--- Zope3/src/ZConfig/matcher.py:1.6	Wed Jan 15 10:25:14 2003
+++ Zope3/src/ZConfig/matcher.py	Tue Feb 11 09:40:46 2003
@@ -120,6 +120,8 @@
         object."""
         length = len(self.type)
         values = self._values
+        # XXX attrnames should be provided by the type, so it can be
+        # computed once per section type
         attrnames = [None] * length
         for i in range(length):
             key, ci = self.type[i]
@@ -167,7 +169,7 @@
                     v = []
                     for s in values[i]:
                         if s is not None:
-                            v.append(s._type.datatype(s))
+                            v.append(s.getSectionDefinition().datatype(s))
                         else:
                             v.append(None)
                 elif ci.name == '+':
@@ -178,7 +180,7 @@
                     v = [vi.convert(ci.datatype) for vi in values[i]]
             elif ci.issection():
                 if values[i] is not None:
-                    v = values[i]._type.datatype(values[i])
+                    v = values[i].getSectionDefinition().datatype(values[i])
                 else:
                     v = None
             elif name == '+':
@@ -195,7 +197,7 @@
         return self.createValue(attrnames)
 
     def createValue(self, attrnames):
-        return SectionValue(attrnames, self._values, None, self.type)
+        return SectionValue(attrnames, self._values, None, self)
 
 
 class SectionMatcher(BaseMatcher):
@@ -208,7 +210,7 @@
         BaseMatcher.__init__(self, info, type, handlers)
 
     def createValue(self, attrnames):
-        return SectionValue(attrnames, self._values, self.name, self.type)
+        return SectionValue(attrnames, self._values, self.name, self)
 
 
 class SchemaMatcher(BaseMatcher):
@@ -232,12 +234,12 @@
     before attempting to modify self.
     """
 
-    def __init__(self, attrnames, values, name, type):
+    def __init__(self, attrnames, values, name, matcher):
         d = self.__dict__
         d['_attrnames'] = attrnames
         d['_values'] = values
         d['_name'] = name
-        d['_type'] = type
+        d['_matcher'] = matcher
 
     def __repr__(self):
         if self._name:
@@ -247,7 +249,7 @@
             # identify uniquely
             name = "at %#x" % id(self)
         clsname = self.__class__.__name__
-        return "<%s for %s %s>" % (clsname, self._type.name, name)
+        return "<%s for %s %s>" % (clsname, self._matcher.type.name, name)
 
     def __len__(self):
         return len(self._values)
@@ -289,4 +291,10 @@
         return self._name
 
     def getSectionType(self):
-        return self._type.name
+        return self._matcher.type.name
+
+    def getSectionDefinition(self):
+        return self._matcher.type
+
+    def getSectionMatcher(self):
+        return self._matcher


=== Zope3/src/ZConfig/url.py 1.5 => 1.5.4.1 ===
--- Zope3/src/ZConfig/url.py:1.5	Wed Jan 15 13:44:33 2003
+++ Zope3/src/ZConfig/url.py	Tue Feb 11 09:40:46 2003
@@ -17,10 +17,7 @@
 hostpart seperator; the functions here enforce this constraint.
 """
 
-import posixpath as _posixpath
 import urlparse as _urlparse
-
-from urllib import splittype as _splittype
 
 try:
     from urlparse import urlsplit