[Mpuls-commits] r2731 - in base/trunk: . mpulsweb/config
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri May 21 19:55:00 CEST 2010
Author: bh
Date: 2010-05-21 19:54:59 +0200 (Fri, 21 May 2010)
New Revision: 2731
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/config/environment.py
Log:
* mpulsweb/config/environment.py (load_environment): Add an
explicit configuration option for the template module directory:
mpuls.app.path.template_cache. If that option is not given use
the previously used directory as fallback. The previously used
directory is simply derived from cache_dir and is this directly
tied to the beaker session directory. This is a problem if two
applications have to share their session data but not their
templates.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2010-05-21 17:49:26 UTC (rev 2730)
+++ base/trunk/ChangeLog 2010-05-21 17:54:59 UTC (rev 2731)
@@ -1,5 +1,16 @@
2010-05-21 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/config/environment.py (load_environment): Add an
+ explicit configuration option for the template module directory:
+ mpuls.app.path.template_cache. If that option is not given use
+ the previously used directory as fallback. The previously used
+ directory is simply derived from cache_dir and is this directly
+ tied to the beaker session directory. This is a problem if two
+ applications have to share their session data but not their
+ templates.
+
+2010-05-21 Bernhard Herzog <bh at intevation.de>
+
* mpulsweb/config/environment.py (load_environment): Lookup
settings in both app_conf and global_conf, instead of only in
global_conf. This allows the settings to be in the application's
Modified: base/trunk/mpulsweb/config/environment.py
===================================================================
--- base/trunk/mpulsweb/config/environment.py 2010-05-21 17:49:26 UTC (rev 2730)
+++ base/trunk/mpulsweb/config/environment.py 2010-05-21 17:54:59 UTC (rev 2731)
@@ -89,11 +89,13 @@
config['pylons.h'] = mpulsweb.lib.helpers
# Create the Mako TemplateLookup, with the default auto-escaping
+ module_directory = config.get('mpuls.app.path.template_cache',
+ os.path.join(app_conf['cache_dir'],
+ 'templates'))
config['pylons.g'].mako_lookup = \
TemplateLookup(directories=paths['templates'],
error_handler=handle_mako_error,
- module_directory=os.path.join(app_conf['cache_dir'],
- 'templates'),
+ module_directory=module_directory,
input_encoding='utf-8', default_filters=['escape'],
imports=['from webhelpers.html import escape'])
More information about the Mpuls-commits
mailing list