[Zope-Checkins] CVS: Zope3/lib/python/Zope/App - config.py:1.1.2.6
Jim Fulton
jim@zope.com
Thu, 3 Jan 2002 14:29:53 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App
In directory cvs.zope.org:/tmp/cvs-serv16747/App
Modified Files:
Tag: Zope-3x-branch
config.py
Log Message:
Refactored configuration framework:
- Configuration directives must be written to a
a different framework. See
ConfigurationDirectiveInterfaces.
- Configuration directives now don't take actions immediately.
Instead, they return a sequence of discriminators and callables
objects with arguments. This allows configuration to be defered to
allow overriding and conflct detection.
- Can now detect conflicting directives
- Can override directives. Directives in including configuration files
override directives in included files. Conflicting directives are
decided based on discriminators.
- Added new directives for defining directives. All directives, except
for a few bootstrap irectives, are now configurable in the
configuration file. This makes directives a little more discoverable
and facilitates extension of directives.
=== Zope3/lib/python/Zope/App/config.py 1.1.2.5 => 1.1.2.6 ===
import os
-from Zope.Configuration.xmlconfig import xmlconfig
+from Zope.Configuration.xmlconfig import XMLConfig
from Zope.Configuration.meta import register
from Zope.Configuration import namespace
def config(dir):
- from Zope.ComponentArchitecture.metaConfigure import metaConfigure
- metaConfigure()
- from Zope.App.ZMI.metaConfigure import metaConfigure
- metaConfigure()
- from Zope.Publisher.Browser.metaConfigure import metaConfigure
- metaConfigure()
- from Zope.App.Security.metaConfigure import metaConfigure
- metaConfigure()
-
- def config_file(file):
- file=open(os.path.join(dir, file))
- xmlconfig(file)
-
- register(namespace('zope'), 'include', config_file)
-
- file=open(os.path.join(dir, 'site.zcml'))
- xmlconfig(file)
+ XMLConfig(os.path.join(dir, 'site.zcml'))()