[Mpuls-commits] r2711 - base/trunk/mpulsweb/config
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon May 17 16:51:18 CEST 2010
Author: torsten
Date: 2010-05-17 16:51:17 +0200 (Mon, 17 May 2010)
New Revision: 2711
Modified:
base/trunk/mpulsweb/config/importer.py
Log:
Append root dir of the application configuration to the pythonpath
Modified: base/trunk/mpulsweb/config/importer.py
===================================================================
--- base/trunk/mpulsweb/config/importer.py 2010-05-17 08:35:34 UTC (rev 2710)
+++ base/trunk/mpulsweb/config/importer.py 2010-05-17 14:51:17 UTC (rev 2711)
@@ -1,5 +1,6 @@
"""Functions to import modules from a specialization or the base"""
+import sys
import logging
from paste.util.import_string import try_import_module, import_module
@@ -23,6 +24,11 @@
it cannot be imported from either location, an exception will be
raised (most likely an ImportError).
"""
+
+ # Append root dir of the application configuration to the pythonpath
+ app_root = config.get('mpuls.app.root')
+ sys.path.append(app_root)
+
instance_module = config.get('mpuls.app.instance') + "." + modulename
module = try_import_module(instance_module)
if module is not None:
More information about the Mpuls-commits
mailing list