[Mpuls-commits] r1856 - in wasko/branches/2.0: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 26 20:05:16 CET 2010


Author: bh
Date: 2010-02-26 20:05:11 +0100 (Fri, 26 Feb 2010)
New Revision: 1856

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/lib/config.py
Log:
* mpulsweb/lib/config.py (MpulsConfig.__init__): Register the json
config file with paste so that the paste server restarts
automatically when the file changes.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-26 16:45:21 UTC (rev 1855)
+++ wasko/branches/2.0/ChangeLog	2010-02-26 19:05:11 UTC (rev 1856)
@@ -1,5 +1,11 @@
 2010-02-26  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/config.py (MpulsConfig.__init__): Register the json
+	config file with paste so that the paste server restarts
+	automatically when the file changes.
+
+2010-02-26  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/renderer.py (ViewRenderer._renderDummyGroup)
 	(ViewRenderer._renderDummyLeaf): Removed.  Unused.
 

Modified: wasko/branches/2.0/mpulsweb/lib/config.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/config.py	2010-02-26 16:45:21 UTC (rev 1855)
+++ wasko/branches/2.0/mpulsweb/lib/config.py	2010-02-26 19:05:11 UTC (rev 1856)
@@ -13,6 +13,8 @@
 
 import simplejson as json
 
+from paste.reloader import watch_file
+
 import pylons
 
 
@@ -59,6 +61,9 @@
                 log.info("Loading configfile: %s" % filename)
                 cfg = json.load(f)
                 log.info("Loading OK")
+                # when running under the paste server, automatically
+                # restart if the file changes.
+                watch_file(filename)
             finally:
                 f.close()
             merge(self.config, cfg)



More information about the Mpuls-commits mailing list