iro/config.py
branchdevel
changeset 188 4d6130d91e56
parent 187 352527f2b6ca
child 220 602720314930
--- a/iro/config.py	Sat Feb 25 16:22:21 2012 +0100
+++ b/iro/config.py	Sun Feb 26 17:48:28 2012 +0100
@@ -41,7 +41,7 @@
             "port":Option(partial(vInteger,minv=0),long="Port under that twisted is running",must=True),
             "dburl":Option(lambda x,y:x,long="Connection URL to database",must=True),
         }
-        self.read=False
+        self._init=True
 
 
     def _read(self, cfg, write=False):
@@ -51,7 +51,7 @@
             try:
                 value = option.validate(c[o],o)
                 if write:
-                    self.read = True
+                    self.init = False
                     setattr(self,o,value)
             except KeyError:
                 if option.must:
@@ -75,12 +75,13 @@
 def readConfig():
     configParser.read(confFiles)
     configParser.reload()
-    if not main.read:
+    if main._init:
         main.load(configParser.items("main"))
     else:
-        m = Config("main").load(configParser.items("main"))
+        m = Config("main")
+        m.load(configParser.items("main"))
         if not main.same(m):
-            raise Exception("Main options can't be reloaded, you have to restart.")
+            raise Exception("Main options can't be reloaded, please restart your Application.")
 
 def registerSignal():
     '''register readConfig to SIGUSR2'''