Trees | Index | Help |
|
---|
Package zope :: Package configuration :: Module xmlconfig |
|
Support for the XML configuration file format
Note, for a detailed description of the way that conflicting configuration actions are resolved, see the detailed example in test_includeOverrides in tests/text_xmlconfig.py
$Id: xmlconfig.py,v 1.2 2005/06/24 16:52:27 nyergler Exp $
Classes | |
---|---|
ConfigurationHandler |
Interface to the xml parser |
IInclude |
The zope:include directive |
ParserInfo |
Information about a directive based on parser data |
XMLConfig |
Provide high-level handling of configuration files. |
Exceptions | |
---|---|
ZopeSAXParseException |
Sax Parser errors, reformatted in an emacs friendly way |
ZopeXMLConfigurationError |
Zope XML Configuration error |
Function Summary | |
---|---|
Execute a zcml file | |
Include a zcml file | |
Include zcml file containing overrides | |
Open a file, falling back to filename.in. | |
Process a configuration file | |
registerCommonDirectives(context)
| |
Execute a zcml string | |
xmlconfig that doesn't raise configuration errors | |
xmlconfig(file,
testing)
|
Variable Summary | |
---|---|
Logger |
logger = <logging.Logger instance at 0xb64c554c>
|
tuple |
ZCML_CONDITION = ('http://namespaces.zope.org/zcml', u'c...
|
str |
ZCML_NAMESPACE = 'http://namespaces.zope.org/zcml'
|
Function Details |
---|
file(name, package=None, context=None, execute=True)Execute a zcml file |
include(_context, file=None, package=None, files=None)Include a zcml file See examples in tests/text_xmlconfig.py |
includeOverrides(_context, file, package=None)Include zcml file containing overrides The actions in the included file are added to the context as if they were in the including file directly. See the detailed example in test_includeOverrides in tests/text_xmlconfig.py |
openInOrPlain(filename)Open a file, falling back to filename.in. If the requested file does not exist and filename.in does, fall back to filename.in. If opening the original filename fails for any other reason, allow the failure to propogate. For example, the tests/samplepackage dirextory has files: configure.zcml configure.zcml.in foo.zcml.in If we open configure.zcml, we'll get that file: >>> here = os.path.dirname(__file__) >>> path = os.path.join(here, 'tests', 'samplepackage', 'configure.zcml') >>> f = openInOrPlain(path) >>> f.name[-14:] 'configure.zcml' But if we open foo.zcml, we'll get foo.zcml.in, since there isn't a foo.zcml: >>> path = os.path.join(here, 'tests', 'samplepackage', 'foo.zcml') >>> f = openInOrPlain(path) >>> f.name[-11:] 'foo.zcml.in' Make sure other IOErrors are re-raised. We need to do this in a try-except block because different errors are raised on Windows and on Linux. >>> try: ... f = openInOrPlain('.') ... except IOError: ... print "passed" ... else: ... print "failed" ... passed |
processxmlfile(file, context, testing=False)Process a configuration file See examples in tests/text_xmlconfig.py |
string(s, context=None, name='<string>', execute=True)Execute a zcml string |
testxmlconfig(file, context=None)xmlconfig that doesn't raise configuration errors This is useful for testing, as it doesn't mask exception types. |
Variable Details |
---|
logger
|
ZCML_CONDITION
|
ZCML_NAMESPACE
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Fri Jun 24 12:01:21 2005 | http://epydoc.sf.net |