summaryrefslogtreecommitdiff
path: root/repoze/bfg/settings.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-06-30 21:02:00 +0000
committerChris McDonough <chrism@agendaless.com>2009-06-30 21:02:00 +0000
commitd809ac74d19342bcc84e4fe043697709b2001cc0 (patch)
tree9973b531b90336bf6ecf3811aa3b9ba753f4e6d8 /repoze/bfg/settings.py
parentf9e73ea5a9d5a4210e3a346aa2f9483d70d22ab9 (diff)
downloadpyramid-d809ac74d19342bcc84e4fe043697709b2001cc0.tar.gz
pyramid-d809ac74d19342bcc84e4fe043697709b2001cc0.tar.bz2
pyramid-d809ac74d19342bcc84e4fe043697709b2001cc0.zip
- Add a ``reload_resources`` configuration file setting (aka the
``BFG_RELOAD_RESOURCES`` environment variable). When this is set to true, the server never needs to be restarted when moving files between directory resource overrides (esp. for templates currently). - Add a ``reload_all`` configuration file setting (aka the ``BFG_RELOAD_ALL`` environment variable) that implies both ``reload_resources`` and ``reload_templates``. - The ``static`` helper view class now uses a ``PackageURLParser`` in order to allow for the overriding of static resources (CSS / logo files, etc) using the ``resource`` ZCML directive. The ``PackageURLParser`` class was added to a (new) ``static`` module in BFG; it is a subclass of the ``StaticURLParser`` class in ``paste.urlparser``. - The ``repoze.bfg.templating.renderer_from_cache`` function now checks for the ``reload_resources`` setting; if it's true, it does not register a template renderer (it won't use the registry as a template renderer cache). - Add ``pkg_resources`` to the glossary. - Update the "Environment" docs to note the existence of ``reload_resources`` and ``reload_all``. - Use a colon instead of a tab as the separator between package name and relpath to form the "spec" when register a ITemplateRenderer.
Diffstat (limited to 'repoze/bfg/settings.py')
-rw-r--r--repoze/bfg/settings.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/repoze/bfg/settings.py b/repoze/bfg/settings.py
index df2a5e99e..08607f756 100644
--- a/repoze/bfg/settings.py
+++ b/repoze/bfg/settings.py
@@ -40,6 +40,9 @@ def get_options(kw, environ=os.environ):
config_debug_all = kw.get('debug_all', '')
effective_debug_all = asbool(eget('BFG_DEBUG_ALL',
config_debug_all))
+ config_reload_all = kw.get('reload_all', '')
+ effective_reload_all = asbool(eget('BFG_RELOAD_ALL',
+ config_reload_all))
config_debug_auth = kw.get('debug_authorization', '')
effective_debug_auth = asbool(eget('BFG_DEBUG_AUTHORIZATION',
config_debug_auth))
@@ -49,10 +52,14 @@ def get_options(kw, environ=os.environ):
config_reload_templates = kw.get('reload_templates', '')
effective_reload_templates = asbool(eget('BFG_RELOAD_TEMPLATES',
config_reload_templates))
+ config_reload_resources = kw.get('reload_resources', '')
+ effective_reload_resources = asbool(eget('BFG_RELOAD_RESOURCES',
+ config_reload_resources))
update = {
'debug_authorization': effective_debug_all or effective_debug_auth,
'debug_notfound': effective_debug_all or effective_debug_notfound,
- 'reload_templates': effective_reload_templates,
+ 'reload_templates': effective_reload_all or effective_reload_templates,
+ 'reload_resources':effective_reload_all or effective_reload_resources,
}
kw.update(update)