[Zope3-checkins] CVS: Zope3/lib/python/Zope/Configuration - xmlconfig.py:1.8.6.4
Jim Fulton
jim@zope.com
Tue, 22 Oct 2002 09:16:37 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Configuration
In directory cvs.zope.org:/tmp/cvs-serv16750
Modified Files:
Tag: Zope3-Bangalore-TTW-Branch
xmlconfig.py
Log Message:
Changed the simple xmlconfig, which reads data from a single file, to
support None as a descriminator, which indicates that an action never
conflicts. I also made the conflict error output emacs compile-mode
friendly.
=== Zope3/lib/python/Zope/Configuration/xmlconfig.py 1.8.6.3 => 1.8.6.4 ===
--- Zope3/lib/python/Zope/Configuration/xmlconfig.py:1.8.6.3 Mon Oct 21 09:17:27 2002
+++ Zope3/lib/python/Zope/Configuration/xmlconfig.py Tue Oct 22 09:16:37 2002
@@ -168,9 +168,12 @@
def __str__(self):
return """Conflicting configuration action:
%s
- at line %s column %s of %s
- and% at line %s column %s of %s
- """ % ((self.des,) + self.l1 + self.l2)
+ File "%s", line %s column %s
+ File "%s", line %s column %s
+ """ % (self.des,
+ self.l1[2], self.l1[0], self.l1[1],
+ self.l2[2], self.l2[0], self.l2[1],
+ )
class Context:
def __init__(self, stack, module):
@@ -229,10 +232,12 @@
if call:
descriptors = {}
for level, loc, des, callable, args, kw in call:
- if des in descriptors:
- raise ZopeConflictingConfigurationError(
- descriptors[des], loc, des)
- descriptors[des] = loc
+ if des is not None:
+ if des in descriptors:
+ raise ZopeConflictingConfigurationError(
+ descriptors[des], loc, des)
+ descriptors[des] = loc
+
callable(*args, **kw)
def testxmlconfig(file, actions=None, context=None, directives=None):