diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-11-19 10:44:55 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-11-19 10:44:55 +0000 |
| commit | eac7c470021b647d63c2e2af8acd6cebd738f2a4 (patch) | |
| tree | 6d04102c9442c0dd67a26d002ff89ae51b454993 /repoze/bfg/zcml.py | |
| parent | 4dd55a50a7ed559748661f369313030773d13e75 (diff) | |
| download | pyramid-eac7c470021b647d63c2e2af8acd6cebd738f2a4.tar.gz pyramid-eac7c470021b647d63c2e2af8acd6cebd738f2a4.tar.bz2 pyramid-eac7c470021b647d63c2e2af8acd6cebd738f2a4.zip | |
Rearrange things to try to avoid circular import deps.
Diffstat (limited to 'repoze/bfg/zcml.py')
| -rw-r--r-- | repoze/bfg/zcml.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/repoze/bfg/zcml.py b/repoze/bfg/zcml.py index a7c5f2660..eae53c337 100644 --- a/repoze/bfg/zcml.py +++ b/repoze/bfg/zcml.py @@ -1,5 +1,7 @@ from zope.configuration.exceptions import ConfigurationError from zope.configuration.fields import GlobalObject +from zope.configuration.config import ConfigurationMachine +from zope.configuration import xmlconfig from zope.interface import Interface @@ -22,7 +24,6 @@ from repoze.bfg.authentication import RepozeWho1AuthenticationPolicy from repoze.bfg.authentication import RemoteUserAuthenticationPolicy from repoze.bfg.authentication import AuthTktAuthenticationPolicy from repoze.bfg.authorization import ACLAuthorizationPolicy -from repoze.bfg.configuration import zcml_configure from repoze.bfg.configuration import Configurator from repoze.bfg.path import package_name from repoze.bfg.request import route_request_iface @@ -536,5 +537,19 @@ class Uncacheable(object): """ Include in discriminators of actions which are not cacheable; this class only exists for backwards compatibility (<0.8.1)""" +def zcml_configure(name, package): + """ Given a ZCML filename as ``name`` and a Python package as + ``package`` which the filename should be relative to, load the + ZCML into the current ZCML registry. + + .. note:: This feature is new as of :mod:`repoze.bfg` 1.1. + """ + context = ConfigurationMachine() + xmlconfig.registerCommonDirectives(context) + context.package = package + xmlconfig.include(context, name, package) + context.execute_actions(clear=False) # the raison d'etre + return context.actions + file_configure = zcml_configure # backwards compat (>0.8.1) |
