[Zope3-checkins] CVS: Zope3/src/zope/configuration - config.py:1.25 docutils.py:1.4

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Mar 29 10:09:06 EST 2004


Update of /cvs-repository/Zope3/src/zope/configuration
In directory cvs.zope.org:/tmp/cvs-serv21542/src/zope/configuration

Modified Files:
	config.py docutils.py 
Log Message:


Support handler in data structure.




=== Zope3/src/zope/configuration/config.py 1.24 => 1.25 ===
--- Zope3/src/zope/configuration/config.py:1.24	Mon Mar 15 15:42:30 2004
+++ Zope3/src/zope/configuration/config.py	Mon Mar 29 10:09:05 2004
@@ -369,16 +369,19 @@
 
     >>> r._docRegistry
     []
-    >>> r.document(('ns', 'dir'), IFullInfo, IConfigurationContext, 'inf', None)
+    >>> r.document(('ns', 'dir'), IFullInfo, IConfigurationContext, None,
+    ...            'inf', None)
     >>> r._docRegistry[0][0] == ('ns', 'dir')
     1
     >>> r._docRegistry[0][1] is IFullInfo
     1
     >>> r._docRegistry[0][2] is IConfigurationContext
     1
-    >>> r._docRegistry[0][3] == 'inf'
+    >>> r._docRegistry[0][3] is None
     1
-    >>> r._docRegistry[0][4] is None
+    >>> r._docRegistry[0][4] == 'inf'
+    1
+    >>> r._docRegistry[0][5] is None
     1
     >>> r.document('all-dir', None, None, None, None)
     >>> r._docRegistry[1][0]
@@ -401,10 +404,10 @@
 
         r.register([interface], Interface, '', factory)
 
-    def document(self, name, schema, usedIn, info, parent=None):
+    def document(self, name, schema, usedIn, handler, info, parent=None):
         if isinstance(name, (str, unicode)):
             name = ('', name)
-        self._docRegistry.append((name, schema, usedIn, info, parent))
+        self._docRegistry.append((name, schema, usedIn, handler, info, parent))
 
     def factory(self, context, name):
         r = self._registry.get(name)
@@ -1064,7 +1067,7 @@
         return SimpleStackItem(context, handler, info, schema, data)
 
     context.register(usedIn, name, factory)
-    context.document(name, schema, usedIn, context.info)
+    context.document(name, schema, usedIn, handler, context.info)
 
 def defineGroupingDirective(context, name, schema, handler,
                             namespace='', usedIn=IConfigurationContext):
@@ -1123,7 +1126,7 @@
         return GroupingStackItem(newcontext)
 
     context.register(usedIn, name, factory)
-    context.document(name, schema, usedIn, context.info)
+    context.document(name, schema, usedIn, handler, context.info)
 
 
 class IComplexDirectiveContext(IFullInfo, IConfigurationContext):
@@ -1144,10 +1147,11 @@
 
         self.register(self.usedIn, (self.namespace, self.name), factory)
         self.document((self.namespace, self.name), self.schema, self.usedIn,
-                      self.info)
+                      self.handler, self.info)
 
 def subdirective(context, name, schema):
     context.document((context.namespace, name), schema, context.usedIn,
+                     getattr(context.handler, name, context.handler),
                      context.info, context.context)
     context.context[name] = schema, context.info
 


=== Zope3/src/zope/configuration/docutils.py 1.3 => 1.4 ===
--- Zope3/src/zope/configuration/docutils.py:1.3	Wed Mar 17 12:59:30 2004
+++ Zope3/src/zope/configuration/docutils.py	Mon Mar 29 10:09:05 2004
@@ -69,18 +69,19 @@
 
     'namespaces' is a dictionary that maps namespaces to a directives
     dictionary with the key being the name of the directive and the value is a
-    tuple: (schema, info).
+    tuple: (schema, handler, info).
 
     'subdirs' maps a (namespace, name) pair to a list of subdirectives that
     have the form (namespace, name, schema, info).
     """
     namespaces = {}
     subdirs = {}
-    for (namespace, name), schema, usedIn, info, parent in context._docRegistry:
+    registry = context._docRegistry
+    for (namespace, name), schema, usedIn, handler, info, parent in registry:
         if not parent:
             ns_entry = namespaces.setdefault(namespace, {})
-            ns_entry[name] = (schema, info)
+            ns_entry[name] = (schema, handler, info)
         else:
             sd_entry = subdirs.setdefault((parent.namespace, parent.name), [])
-            sd_entry.append((namespace, name, schema, info))
+            sd_entry.append((namespace, name, schema, handler, info))
     return namespaces, subdirs    




More information about the Zope3-Checkins mailing list