changeset 4243:e116e90ffdec

Copy over defaults from DefaultConfig if missing
author Florian Krupicka <florian.krupicka@googlemail.com>
date Thu, 24 Jul 2008 20:35:13 +0200
parents f61dcab20a3e
children 521dbdec654e
files MoinMoin/script/server/standalone.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/server/standalone.py	Tue Jul 22 21:02:07 2008 +0200
+++ b/MoinMoin/script/server/standalone.py	Thu Jul 24 20:35:13 2008 +0200
@@ -79,7 +79,7 @@
             try:
                 if self.options.config_dir:
                     sys.path.insert(0, self.options.config_dir)
-                from wikiconfig import Config
+                from wikiserverconfig import Config
             except ImportError, err:
                 if 'Config' in str(err):
                     # we are unable to import Config
@@ -88,6 +88,13 @@
                     # some other import went wrong
                     raise
 
+            # intialize some defaults if missing
+            for option in ('docs', 'user', 'group', 'port', 'interface'):
+                if not hasattr(Config, option):
+                    value = getattr(DefaultConfig, option)
+                    setattr(Config, option, value)
+
+            # override with cmdline options
             if self.options.docs:
                 Config.docs = self.options.docs
             if self.options.user:
@@ -119,3 +126,4 @@
     group = ''
     port = 8080
     interface = 'localhost'
+    reload_server = False