diff wikiconfig.py @ 4624:fb5abe50c6d2

wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 01 Mar 2009 21:57:08 +0100
parents 173c67aff3d6
children 9a26c69ccf5a
line wrap: on
line diff
--- a/wikiconfig.py	Sun Mar 01 19:22:59 2009 +0100
+++ b/wikiconfig.py	Sun Mar 01 21:57:08 2009 +0100
@@ -5,21 +5,38 @@
 
 This is NOT intended for internet or server or multiuser use due to relaxed security settings!
 """
+
 import sys, os
-from MoinMoin.config.multiconfig import DefaultConfig
+
+from MoinMoin.config import multiconfig, url_prefix_static
 
 
-class LocalConfig(DefaultConfig):
+class LocalConfig(multiconfig.DefaultConfig):
     # vvv DON'T TOUCH THIS EXCEPT IF YOU KNOW WHAT YOU DO vvv
-    moinmoin_dir = os.path.abspath(os.path.normpath(os.path.dirname(sys.argv[0])))
-    data_dir = os.path.join(moinmoin_dir, 'wiki', 'data')
-    data_underlay_dir = os.path.join(moinmoin_dir, 'wiki', 'underlay')
+    # Directory containing THIS wikiconfig:
+    wikiconfig_dir = os.path.abspath(os.path.dirname(__file__))
+
+    # We assume this structure for a simple "unpack and run" scenario:
+    # wikiconfig.py
+    # wiki/
+    #      data/
+    #      underlay/
+    # If that's not true, feel free to just set instance_dir to the real path
+    # where data/ and underlay/ is located:
+    #instance_dir = '/where/ever/your/instance/is'
+    instance_dir = os.path.join(wikiconfig_dir, 'wiki')
+
+    # Where your own wiki pages are (make regular backups of this directory):
+    data_dir = os.path.join(instance_dir, 'data', '') # path with trailing /
+
+    # Where system and help pages are (you may exclude this from backup):
+    data_underlay_dir = os.path.join(instance_dir, 'underlay', '') # path with trailing /
 
     DesktopEdition = True # give all local users full powers
     acl_rights_default = u"All:read,write,delete,revert,admin"
     surge_action_limits = None # no surge protection
     sitename = u'MoinMoin DesktopEdition'
-    logo_string = u'<img src="/moin_static190/common/moinmoin.png" alt="MoinMoin Logo">'
+    logo_string = u'<img src="%s/common/moinmoin.png" alt="MoinMoin Logo">' % url_prefix_static
     page_front_page = u'FrontPage' # change to some better value
     # ^^^ DON'T TOUCH THIS EXCEPT IF YOU KNOW WHAT YOU DO ^^^
 
@@ -43,3 +60,4 @@
     if not str(err).endswith('wikiconfig_local'):
         raise
     Config = LocalConfig
+