[Zope-Checkins] CVS: Zope3/lib/python/Zope/Configuration - meta.py:1.1.2.7.6.2 xmlconfig.py:1.1.2.10.4.2
Jim Fulton
jim@zope.com
Tue, 26 Mar 2002 19:00:56 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Configuration
In directory cvs.zope.org:/tmp/cvs-serv16764/lib/python/Zope/Configuration
Modified Files:
Tag: contextual-directives
meta.py xmlconfig.py
Log Message:
Debugged change to xmlconfigurator to allow dotted names to be
relative to include package.
=== Zope3/lib/python/Zope/Configuration/meta.py 1.1.2.7.6.1 => 1.1.2.7.6.2 ===
return lambda: r, subs
-def begin(_custom_directives, _name, context, **kw):
+def begin(_custom_directives, _name, _context, **kw):
if _custom_directives and (_name in _custom_directives):
callable, subs = _custom_directives[_name]
else:
@@ -50,9 +50,9 @@
except KeyError:
raise InvalidDirective(_name)
- return _exe(callable, subs, context, kw)
+ return _exe(callable, subs, _context, kw)
-def sub(subs, _name, context, **kw):
+def sub(subs, _name, _context, **kw):
base, subdirs = subs
@@ -63,7 +63,7 @@
callable = getattr(base, _name[1])
- return _exe(callable, subs, context, kw)
+ return _exe(callable, subs, _context, kw)
defaultkw = ({},)
def end(base):
@@ -79,7 +79,7 @@
class DirectiveNamespace:
- def __init__(self, namespace):
+ def __init__(self, _context, namespace):
self._namespace = namespace
def directive(self, _context, name, handler, attributes='',
=== Zope3/lib/python/Zope/Configuration/xmlconfig.py 1.1.2.10.4.1 => 1.1.2.10.4.2 ===
def resolve(self, dottedname):
- name.resolve(dottedname, self.__package)
+ return name.resolve(dottedname, self.__package)
def xmlconfig(file, actions=None, context=None, directives=None):
@@ -163,13 +163,13 @@
context = name
if actions is None:
- call=actions=[]
+ call = actions = []
else:
- call=0
+ call = 0
- src=InputSource(getattr(file, 'name', '<string>'))
+ src = InputSource(getattr(file, 'name', '<string>'))
src.setByteStream(file)
- parser=make_parser()
+ parser = make_parser()
parser.setContentHandler(ConfigurationHandler(actions, context,
directives))
parser.setFeature(feature_namespaces, 1)
@@ -181,7 +181,7 @@
if des in descriptors:
raise ZopeConflictingConfigurationError(
descriptors[des], loc, des)
- descriptors[des]=loc
+ descriptors[des] = loc
callable(*args, **kw)
class ZopeConfigurationConflictError(ZopeXMLConfigurationError):
@@ -249,9 +249,9 @@
# organize actions by discriminators
unique = {}
for i in range(len(actions)):
- path, loc, des, callable, args, kw = actions[i]
+ context, loc, des, callable, args, kw = actions[i]
a = unique.setdefault(des, [])
- a.append((path, i, loc, (callable, args, kw)))
+ a.append((context._stackcopy(), i, loc, (callable, args, kw)))
# Check for conflicts
conflicts = {}