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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 5 19:21:35 CET 2010


Author: bh
Date: 2010-02-05 19:21:34 +0100 (Fri, 05 Feb 2010)
New Revision: 1294

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/config/routing.py
Log:
* mpulsweb/config/routing.py: Fix formatting.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-05 18:16:58 UTC (rev 1293)
+++ wasko/branches/2.0/ChangeLog	2010-02-05 18:21:34 UTC (rev 1294)
@@ -1,5 +1,9 @@
 2010-02-05  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/config/routing.py: Fix formatting.
+
+2010-02-05  Bernhard Herzog  <bh at intevation.de>
+
 	* INSTALL: Add some notes about configuration of fields shown in
 	the case digest and the case overview.
 

Modified: wasko/branches/2.0/mpulsweb/config/routing.py
===================================================================
--- wasko/branches/2.0/mpulsweb/config/routing.py	2010-02-05 18:16:58 UTC (rev 1293)
+++ wasko/branches/2.0/mpulsweb/config/routing.py	2010-02-05 18:21:34 UTC (rev 1294)
@@ -1,42 +1,45 @@
 # Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-# 
-# This file is part of mpuls WASKA (CoMPUter-based case fiLeS - 
+#
+# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
 # Web-Anwendungs-Server fuer Kompetenzagenturen).
-# 
+#
 # mpuls WASKA is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the
 # Free Software Foundation, either version 3 of the License, or (at your
 # option) any later version.
-# 
+#
 # mpuls WASKA is distributed in the hope that it will be useful, but WITHOUT
 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
 # License for more details.
-# 
+#
 # You should have received a copy of the GNU Affero General Public
 # License along with mpuls WASKA. If not, see <http://www.gnu.org/licenses/>.
-# 
-# mpuls WASKA has been developed on behalf of the 
+#
+# mpuls WASKA has been developed on behalf of the
 # Projekttraeger im Deutschen Zentrum fuer Luft- und Raumfahrt e.V. (PT-DLR)
 # within the programme Kompetenzagenturen (Durchfuehrungsphase) funded by
-# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and 
+# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
 # European Social Fund resources.
+
 """Routes configuration
 
 The more specific and detailed routes should be defined first so they
 may take precedent over the more generic routes. For more information
 refer to the routes manual at http://routes.groovie.org/docs/
 """
+
 import os
 import re
 import logging
+
 from pylons import config
 from routes import Mapper
 
 log = logging.getLogger(__name__)
 
 def controller_scan(directory=None):
-    """Scan a directory for python files and use them as controllers""" 
+    """Scan a directory for python files and use them as controllers"""
     log.debug('Scanning for controllers in %s' % directory)
     controllers = []
     if directory is None:
@@ -51,11 +54,14 @@
                 re.match('^[^_]{1,1}.*\.py$', fname):
                 controllers.append(prefix + fname[:-3])
             elif os.path.isdir(filename):
-                controllers.extend(find_controllers(filename, prefix=prefix+fname+'/'))
+                controllers.extend(find_controllers(filename,
+                                                    prefix=prefix + fname +'/'))
         return controllers
+
     def longest_first(fst, lst):
-        """Compare the length of one string to another, shortest goes first""" 
+        """Compare the length of one string to another, shortest goes first"""
         return cmp(len(lst), len(fst))
+
     for dirname in directory:
         controllers.extend(find_controllers(dirname))
     controllers.sort(longest_first)
@@ -67,9 +73,10 @@
     # First try to search to controllers in the instance (WASKO, WASKA, JMD ...)
     controller_dirs = []
     basepath = config['pylons.paths']['controllers']
-    controller_dirs.append(basepath) 
+    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.join(config['mpuls.app.root'], 'mpulsweb',
+                                        'controllers'))
     # Remove duplicate in controller dirs
     controller_dirs = list(set(controller_dirs))
     map = Mapper(controller_scan=controller_scan,
@@ -83,7 +90,9 @@
 
     # CUSTOM ROUTES HERE
 
-    map.connect('/', controller=config.get('mpuls.app.indexcontroller', 'mpuls'), action='index')
+    map.connect('/', controller=config.get('mpuls.app.indexcontroller',
+                                           'mpuls'),
+                action='index')
     map.connect('/{controller}', action='index')
     map.connect('/{controller}/{action}')
     map.connect('/{controller}/{action}/{id}')



More information about the Mpuls-commits mailing list