changeset 4618:0e7c007f8ed9

handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 01 Mar 2009 15:07:39 +0100
parents 8a3c0c726d66
children 9edfdbed12a8
files .hgignore wikiserverconfig.py
diffstat 2 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sun Mar 01 04:11:08 2009 +0100
+++ b/.hgignore	Sun Mar 01 15:07:39 2009 +0100
@@ -6,6 +6,7 @@
 ^wiki/data/event-log
 ^wiki/data/cache/
 ^wikiconfig_local.*
+^wikiserverconfig_local.*
 ^MoinMoin/i18n/POTFILES(\.in)?$
 .coverage
 
--- a/wikiserverconfig.py	Sun Mar 01 04:11:08 2009 +0100
+++ b/wikiserverconfig.py	Sun Mar 01 15:07:39 2009 +0100
@@ -6,7 +6,7 @@
 
 from MoinMoin.script.server.standalone import DefaultConfig
 
-class Config(DefaultConfig):
+class LocalConfig(DefaultConfig):
     port = 8080 # if you use port < 1024, you need to start as root
 
     # if you start the server as root, the standalone server can change
@@ -40,3 +40,19 @@
     # debugger, anything else (or not setting it) will disable the debugger.
     debug = os.environ.get('MOIN_DEBUGGER', 'False') == 'True'
 
+# DEVELOPERS! Do not add your configuration items there,
+# you could accidentally commit them! Instead, create a
+# wikiserverconfig_local.py file containing this:
+#
+# from wikiserverconfig import LocalConfig
+#
+# class Config(LocalConfig):
+#     configuration_item_1 = 'value1'
+#
+
+try:
+    from wikiserverconfig_local import Config
+except ImportError, err:
+    if not str(err).endswith('wikiserverconfig_local'):
+        raise
+    Config = LocalConfig