[Zope3-checkins] CVS: Zope3/src/zope/configuration - meta.py:1.5.12.1 metametaconfigure.py:1.7.4.1 metametaconfigurefordocgen.py:1.5.4.1 xmlconfig.py:1.6.18.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:09 -0400
Update of /cvs-repository/Zope3/src/zope/configuration
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/configuration
Modified Files:
Tag: cw-mail-branch
meta.py metametaconfigure.py metametaconfigurefordocgen.py
xmlconfig.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/configuration/meta.py 1.5 => 1.5.12.1 ===
--- Zope3/src/zope/configuration/meta.py:1.5 Fri Apr 18 18:12:31 2003
+++ Zope3/src/zope/configuration/meta.py Sun Jun 22 10:23:38 2003
@@ -18,8 +18,7 @@
$Id$
"""
-
-from zope.interface import directlyProvides, classProvides
+from zope.interface import directlyProvides, classProvides, implements
from zope.configuration.interfaces import INonEmptyDirective
from zope.configuration.interfaces import ISubdirectiveHandler
@@ -210,7 +209,7 @@
callable, subs = _custom_directives[('*', _name[1])]
else:
raise InvalidDirective(_name)
-
+
except KeyError:
raise InvalidDirective(_name)
@@ -287,7 +286,7 @@
class DirectiveNamespace:
classProvides(INonEmptyDirective)
- __implements__ = ISubdirectiveHandler
+ implements(ISubdirectiveHandler)
def __init__(self, _context, namespace):
self._namespace = namespace
@@ -316,7 +315,7 @@
#
# For this reason, this isn't a good directive example.
- __implements__ = ISubdirectiveHandler
+ implements(ISubdirectiveHandler)
def __init__(self, subs, namespace=None):
self._subs = subs
=== Zope3/src/zope/configuration/metametaconfigure.py 1.7 => 1.7.4.1 ===
--- Zope3/src/zope/configuration/metametaconfigure.py:1.7 Sat May 3 12:34:15 2003
+++ Zope3/src/zope/configuration/metametaconfigure.py Sun Jun 22 10:23:38 2003
@@ -14,7 +14,7 @@
"""
$Id$
"""
-from zope.interface import directlyProvides, classProvides
+from zope.interface import directlyProvides, classProvides, implements
from zope.configuration.meta \
import DirectiveNamespace as bootstrapDirectiveNamespace
from zope.configuration.meta import Subdirective as bootstrapSubdirective
@@ -29,7 +29,6 @@
class DirectiveNamespace(bootstrapDirectiveNamespace):
classProvides(INonEmptyDirective)
- __implements__ = ISubdirectiveHandler
def _Subdirective(self, *args, **kw):
return Subdirective(*args, **kw)
@@ -56,8 +55,6 @@
class Subdirective(bootstrapSubdirective):
"""An extended Subdirective that handles descriptions and attributes"""
- __implements__ = ISubdirectiveHandler
-
def __init__(self, subs, namespace=None, name=None):
bootstrapSubdirective.__init__(self,subs,namespace)
self._name = name
@@ -95,8 +92,8 @@
class Description:
- __implements__ = ISubdirectiveHandler
-
+ implements(ISubdirectiveHandler)
+
def __init__(self, dir):
self._dir = dir
self._description = ''
@@ -113,8 +110,8 @@
class Attribute:
- __implements__ = ISubdirectiveHandler
-
+ implements(ISubdirectiveHandler)
+
def __init__(self, dir, name, required, description=''):
required = required.lower()
if required not in ('', 'yes', 'no'):
@@ -141,8 +138,8 @@
class AttrDescription:
- __implements__ = ISubdirectiveHandler
-
+ implements(ISubdirectiveHandler)
+
def __init__(self, dir):
self._dir = dir
@@ -151,4 +148,3 @@
def __call__(self):
return ()
-
=== Zope3/src/zope/configuration/metametaconfigurefordocgen.py 1.5 => 1.5.4.1 ===
--- Zope3/src/zope/configuration/metametaconfigurefordocgen.py:1.5 Sat May 3 12:34:31 2003
+++ Zope3/src/zope/configuration/metametaconfigurefordocgen.py Sun Jun 22 10:23:38 2003
@@ -80,7 +80,6 @@
"""An extended class that handles descriptions and attributes"""
classProvides(INonEmptyDirective)
- __implements__ = ISubdirectiveHandler
def _Subdirective(self, *args, **kw):
return Subdirective(*args, **kw)
@@ -91,8 +90,6 @@
class Subdirective(baseSubdirective):
"""An extended class that handles descriptions and attributes"""
-
- __implements__ = ISubdirectiveHandler
def _useDescription(self, namespace, name, subs, description):
_recordCommandMetadata(subs, description)
=== Zope3/src/zope/configuration/xmlconfig.py 1.6 => 1.6.18.1 ===
--- Zope3/src/zope/configuration/xmlconfig.py:1.6 Tue Mar 11 15:11:18 2003
+++ Zope3/src/zope/configuration/xmlconfig.py Sun Jun 22 10:23:38 2003
@@ -24,6 +24,7 @@
from xml.sax import make_parser
from xml.sax.xmlreader import InputSource
from xml.sax.handler import ContentHandler, feature_namespaces
+from xml.sax import SAXParseException
from zope.configuration import name
from zope.configuration.meta import begin, sub, end
from zope.configuration.exceptions import ConfigurationError
@@ -53,10 +54,22 @@
self.mess = mess
def __str__(self):
- return 'File "%s", line %s, column %s\n\t%s' % (
+ return 'File "%s", line %s.%s\n\t%s' % (
self.sid, self.lno, self.cno, self.mess)
+class ZopeSAXParseException(ConfigurationError):
+ def __init__(self, v):
+ self._v = v
+
+ def __str__(self):
+ v = self._v
+ s = tuple(str(v).split(':'))
+ if len(s) == 4:
+ return 'File "%s", line %s.%s, %s' % s
+ else:
+ return str(v)
+
class ConfigurationExecutionError(ZopeXMLConfigurationError):
"""An error occurred during execution of a configuration action
"""
@@ -240,7 +253,10 @@
testing=testing)
)
parser.setFeature(feature_namespaces, 1)
- parser.parse(src)
+ try:
+ parser.parse(src)
+ except SAXParseException:
+ raise ZopeSAXParseException, sys.exc_info()[1], sys.exc_info()[2]
if call:
descriptors = {}