[Zope-Checkins] CVS: Zope3/lib/python/Zope/Configuration - meta.py:1.14
R. David Murray
bitz@bitdance.com
Sun, 22 Sep 2002 14:47:08 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Configuration
In directory cvs.zope.org:/tmp/cvs-serv17007
Modified Files:
meta.py
Log Message:
Add missing __implements__ to the 'directive' method of
DirectiveNamespace and the 'subdirective' method of Subdirective.
This fixes the bug highlighted by the extended test: the last
level of subdirective had an empty subdirective registry, so
the Implements check was done by _exe, but 'subdirective' failed
that test. _exe thus returned a lambda returning the instance
instead of the instance itself that end was expecting.
=== Zope3/lib/python/Zope/Configuration/meta.py 1.13 => 1.14 ===
--- Zope3/lib/python/Zope/Configuration/meta.py:1.13 Sun Sep 22 12:05:18 2002
+++ Zope3/lib/python/Zope/Configuration/meta.py Sun Sep 22 14:47:07 2002
@@ -281,6 +281,7 @@
namespace = namespace or self._namespace
subs = register((namespace, name), _context.resolve(handler))
return Subdirective(subs, namespace=namespace)
+ directive.__implements__ = INonEmptyDirective
def __call__(self):
return ()
@@ -314,6 +315,7 @@
#If handler_method is None, registersub will use name.
subs = registersub(self._subs, (namespace, name), handler_method)
return Subdirective(subs,namespace=namespace)
+ subdirective.__implements__ = INonEmptyDirective
def __call__(self):
return ()