[Mpuls-commits] r2696 - in wasko/branches/2.0: . mpulsweb/config

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon May 10 14:34:28 CEST 2010


Author: bh
Date: 2010-05-10 14:34:26 +0200 (Mon, 10 May 2010)
New Revision: 2696

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/config/routing.py
Log:
* mpulsweb/config/routing.py (make_map): Use the directory
containing the python module mpulsweb.controllers as the
controllers directory of the base application instead of assuming
it can be derived from config['mpuls.app.root'].  The new way is
more generic and flexible because just assumes that
mpulsweb.controllers can be imported instead of also making
assumptions about where it's actually located.  This is especially
useful when splitting the base application and jmdweb into
separate components.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-05-10 08:09:06 UTC (rev 2695)
+++ wasko/branches/2.0/ChangeLog	2010-05-10 12:34:26 UTC (rev 2696)
@@ -1,3 +1,15 @@
+2010-05-10  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/config/routing.py (make_map): Use the directory
+	containing the python module mpulsweb.controllers as the
+	controllers directory of the base application instead of assuming
+	it can be derived from config['mpuls.app.root'].  The new way is
+	more generic and flexible because just assumes that
+	mpulsweb.controllers can be imported instead of also making
+	assumptions about where it's actually located.  This is especially
+	useful when splitting the base application and jmdweb into
+	separate components.
+
 2010-05-10  Torsten Irländer <torsten.irlaender at intevation.de>
 	
 	* mpulsweb/templates/main.mako,

Modified: wasko/branches/2.0/mpulsweb/config/routing.py
===================================================================
--- wasko/branches/2.0/mpulsweb/config/routing.py	2010-05-10 08:09:06 UTC (rev 2695)
+++ wasko/branches/2.0/mpulsweb/config/routing.py	2010-05-10 12:34:26 UTC (rev 2696)
@@ -36,6 +36,8 @@
 from pylons import config
 from routes import Mapper
 
+import mpulsweb.controllers
+
 log = logging.getLogger(__name__)
 
 def controller_scan(directory=None):
@@ -75,8 +77,7 @@
     basepath = config['pylons.paths']['controllers']
     controller_dirs.append(basepath)
     # Then append controllers in the Baseapplication
-    controller_dirs.append(os.path.join(config['mpuls.app.root'], 'mpulsweb',
-                                        'controllers'))
+    controller_dirs.append(os.path.dirname(mpulsweb.controllers.__file__))
     # Remove duplicate in controller dirs
     controller_dirs = list(set(controller_dirs))
     map = Mapper(controller_scan=controller_scan,



More information about the Mpuls-commits mailing list