diff options
| author | Chris McDonough <chrism@agendaless.com> | 2008-08-18 04:06:35 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2008-08-18 04:06:35 +0000 |
| commit | e35dc1a58a4e91977dc9819c80259f09800a0b58 (patch) | |
| tree | e90fea96be6f491becd5399f177057f1feeadf68 /repoze/bfg/router.py | |
| parent | 0235914a7c520e20dafcfc251237deddedaf3d80 (diff) | |
| download | pyramid-e35dc1a58a4e91977dc9819c80259f09800a0b58.tar.gz pyramid-e35dc1a58a4e91977dc9819c80259f09800a0b58.tar.bz2 pyramid-e35dc1a58a4e91977dc9819c80259f09800a0b58.zip | |
- Generated application differences: ``make_app`` entry point
renamed to ``app`` in order to have a different name than the bfg
function of the same name, to prevent confusion.
- Add "options" processing to bfg's ``make_app`` to support runtime
options. A new API function named ``get_options`` was added to
the registry module. This function is typically used in an
application's ``app`` entry point. The Paste config file section
for the app can now supply the ``reload_templates`` option, which,
if true, will prevent the need to restart the appserver in order
for ``z3c.pt`` or XSLT template changes to be detected.
- Use only the module name in generated project's "test_suite" (run
all tests found in the package).
- Default port for generated apps changed from 5432 to 6543
(Postgres default port is 6543).
Diffstat (limited to 'repoze/bfg/router.py')
| -rw-r--r-- | repoze/bfg/router.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/repoze/bfg/router.py b/repoze/bfg/router.py index d6b60f5ec..49ccd1ad6 100644 --- a/repoze/bfg/router.py +++ b/repoze/bfg/router.py @@ -74,16 +74,21 @@ def isResponse(ob): isinstance(ob.status, basestring) ) : return True -def make_app(root_policy, package=None, filename='configure.zcml'): +def make_app(root_policy, package=None, filename='configure.zcml', + options=None): """ Create a view registry based on the application's ZCML. and return a Router object, representing a ``repoze.bfg`` WSGI - application. 'root_policy' must be a callable that accepts a WSGI - environment and returns a graph root object. 'package' is the - dotted-Python-path packagename of the application, 'filename' is - the filesystem path to a ZCML file (optionally relative to the - package path) that should be parsed to create the view registry.""" + application. ``root_policy`` must be a callable that accepts a + WSGI environment and returns a graph root object. ``package`` is + a Python module representing the application's package, + ``filename`` is the filesystem path to a ZCML file (optionally + relative to the package path) that should be parsed to create the + view registry. ``options``, if used, should be a dictionary + containing bfg-specific runtime options, with each key + representing the option and the key's value representing the + specific option value, e.g. ``{'reload_templates':True}``""" from repoze.bfg.registry import makeRegistry - registry = makeRegistry(filename, package) + registry = makeRegistry(filename, package, options) return Router(root_policy, registry) |
