[Zope3-checkins] CVS: Zope3/src/zope/configuration - config.py:1.5
Jim Fulton
jim@zope.com
Wed, 30 Jul 2003 10:34:58 -0400
Update of /cvs-repository/Zope3/src/zope/configuration
In directory cvs.zope.org:/tmp/cvs-serv1009/src/zope/configuration
Modified Files:
config.py
Log Message:
Fixed a bug in the management of directive context information for
complex directives.
=== Zope3/src/zope/configuration/config.py 1.4 => 1.5 ===
--- Zope3/src/zope/configuration/config.py:1.4 Tue Jul 29 16:39:37 2003
+++ Zope3/src/zope/configuration/config.py Wed Jul 30 10:34:54 2003
@@ -753,20 +753,15 @@
implements(IStackItem)
def __init__(self, meta, context, data, info):
+
+ newcontext = GroupingContextDecorator(context)
+ newcontext.info = info
+ self.context = newcontext
self.meta = meta
- self.context = context
- self.info = info
# Call the handler contructor
-
- # Need to save and restore old info
- oldinfo = context.info
- context.info = info
-
- args = toargs(context, meta.schema, data)
- self.handler = self.meta.handler(context, **args)
-
- context.info = oldinfo
+ args = toargs(newcontext, meta.schema, data)
+ self.handler = self.meta.handler(newcontext, **args)
def contained(self, name, data, info):
"""Handle a subdirective
@@ -786,8 +781,6 @@
# when we're done, we call the handler, which might return more actions
# Need to save and restore old info
- oldinfo = self.context.info
- self.context.info = self.info
try:
actions = self.handler()
@@ -802,8 +795,6 @@
# we allow the handler to return nothing
for action in actions:
self.context.action(*action)
-
- self.context.info = oldinfo
##############################################################################
# Helper classes