[Mpuls-commits] r2820 - base/trunk/mpulsweb/config

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon May 31 12:02:26 CEST 2010


Author: torsten
Date: 2010-05-31 12:02:19 +0200 (Mon, 31 May 2010)
New Revision: 2820

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-31 10:01:57 UTC (rev 2819)
+++ base/trunk/mpulsweb/config/importer.py	2010-05-31 10:02:19 UTC (rev 2820)
@@ -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