[Mpuls-commits] r4554 - base/trunk/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 2 16:43:48 CET 2011


Author: torsten
Date: 2011-02-02 16:43:47 +0100 (Wed, 02 Feb 2011)
New Revision: 4554

Modified:
   base/trunk/mpulsweb/lib/app_globals.py
Log:
* mpulsweb/lib/app_globals.py: Load configfile and buidl
	ConfigParser-object. Save parser as g.mpuls_ini


Modified: base/trunk/mpulsweb/lib/app_globals.py
===================================================================
--- base/trunk/mpulsweb/lib/app_globals.py	2011-02-02 15:42:04 UTC (rev 4553)
+++ base/trunk/mpulsweb/lib/app_globals.py	2011-02-02 15:43:47 UTC (rev 4554)
@@ -25,7 +25,9 @@
 """The application's Globals object"""
 
 import os
+import re
 import logging
+import ConfigParser
 
 from paste.reloader import watch_file
 from paste.registry import StackedObjectProxy
@@ -79,6 +81,13 @@
         dblist_file = filename_from_config('mpuls.app.dblist',
                                             'default_dblist.json')
 
+
+        # Load ini file and make all sections available a global var.
+        apps = re.compile('app:')
+        self.mpuls_ini = ConfigParser.ConfigParser()
+        path = os.path.join(config['here'], config['__file__'])
+        self.mpuls_ini.readfp(open(path))
+
         self.config_path = os.path.dirname(config_file)
         self.mpuls_config = MpulsAppConfig(config_file)
         self.mpuls_dbmapping = MpulsDBMapping(mapping_file)



More information about the Mpuls-commits mailing list