annotate MoinMoin/config/multiconfig.py @ 3290:abb32b0af96b

revision history: enable the user to get more revisions show by using max_count=123, enable wiki admin to limit that
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 17 Mar 2008 17:17:54 +0100
parents bd322703c85e
children e66f55d0076d
rev   line source
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1 # -*- coding: iso-8859-1 -*-
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
2 """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
3 MoinMoin - Multiple configuration handler and Configuration defaults class
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
4
1918
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
5 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
3126
fac1b1e9ea95 multiconfig: better logging, tell path of config that is used
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3120
diff changeset
6 2005-2008 MoinMoin:ThomasWaldmann.
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
7 @license: GNU GPL, see COPYING for details.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
8 """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
9
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
10 import re
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
11 import os
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
12 import sys
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
13 import time
3107
c6e39279f83b refactor logging usage
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3097
diff changeset
14
3110
a48929a5036c logging: make it work correctly by doing logging configuration very early
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3107
diff changeset
15 from MoinMoin import log
a48929a5036c logging: make it work correctly by doing logging configuration very early
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3107
diff changeset
16 logging = log.getLogger(__name__)
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
17
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1575
diff changeset
18 from MoinMoin import config, error, util, wikiutil
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
19 import MoinMoin.auth as authmodule
2307
fe37834deb3d Move a list of event handlers and subscribable events to config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2227
diff changeset
20 import MoinMoin.events as events
2429
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
21 from MoinMoin.events import PageChangedEvent, PageRenamedEvent
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
22 from MoinMoin.events import PageDeletedEvent, PageCopiedEvent
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
23 from MoinMoin.events import PageRevertedEvent, FileAttachedEvent
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
24 from MoinMoin import session
1096
33927b0256ce Changed marshalling format of the full IWID, load full IWID into the RemoteWiki object.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1080
diff changeset
25 from MoinMoin.packages import packLine
1276
7c29a18a7e26 more memory efficient and faster ACL processing, do not have before/after/default acl in ACL object, but only once in cfg
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1212
diff changeset
26 from MoinMoin.security import AccessControlList
2595
5e7b45489430 moved python2.3/2.4 compatibility code to MoinMoin.support.python_compatibility (thanks to Heinrich Wendel)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2491
diff changeset
27 from MoinMoin.support.python_compatibility import set
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
28
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
29 _url_re_cache = None
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
30 _farmconfig_mtime = None
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
31 _config_cache = {}
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
32
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
33
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
34 def _importConfigModule(name):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
35 """ Import and return configuration module and its modification time
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
36
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
37 Handle all errors except ImportError, because missing file is not
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
38 always an error.
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
39
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
40 @param name: module name
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
41 @rtype: tuple
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
42 @return: module, modification time
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
43 """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
44 try:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
45 module = __import__(name, globals(), {})
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
46 mtime = os.path.getmtime(module.__file__)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
47 except ImportError:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
48 raise
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
49 except IndentationError, err:
3157
b8cb12fa571b logging: using more logging.exception
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3149
diff changeset
50 logging.exception('Your source code / config file is not correctly indented!')
915
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
51 msg = '''IndentationError: %(err)s
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
52
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
53 The configuration files are python modules. Therefore, whitespace is
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
54 important. Make sure that you use only spaces, no tabs are allowed here!
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
55 You have to use four spaces at the beginning of the line mostly.
915
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
56 ''' % {
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
57 'err': err,
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
58 }
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
59 raise error.ConfigurationError(msg)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
60 except Exception, err:
3157
b8cb12fa571b logging: using more logging.exception
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3149
diff changeset
61 logging.exception('An exception happened.')
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
62 msg = '%s: %s' % (err.__class__.__name__, str(err))
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
63 raise error.ConfigurationError(msg)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
64 return module, mtime
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
65
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
66
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
67 def _url_re_list():
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
68 """ Return url matching regular expression
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
69
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
70 Import wikis list from farmconfig on the first call and compile the
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
71 regexes. Later then return the cached regex list.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
72
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
73 @rtype: list of tuples of (name, compiled re object)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
74 @return: url to wiki config name matching list
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
75 """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
76 global _url_re_cache, _farmconfig_mtime
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
77 if _url_re_cache is None:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
78 try:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
79 farmconfig, _farmconfig_mtime = _importConfigModule('farmconfig')
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
80 except ImportError:
3126
fac1b1e9ea95 multiconfig: better logging, tell path of config that is used
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3120
diff changeset
81 logging.debug("could not import farmconfig, mapping all URLs to wikiconfig")
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
82 _farmconfig_mtime = 0
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
83 _url_re_cache = [('wikiconfig', re.compile(r'.')), ] # matches everything
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
84 else:
3129
d57fed1b0b43 multiconfig: also log which farmconfig we use
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3126
diff changeset
85 logging.info("using farm config: %s" % os.path.abspath(farmconfig.__file__))
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
86 try:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
87 cache = []
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
88 for name, regex in farmconfig.wikis:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
89 cache.append((name, re.compile(regex)))
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
90 _url_re_cache = cache
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
91 except AttributeError:
3126
fac1b1e9ea95 multiconfig: better logging, tell path of config that is used
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3120
diff changeset
92 logging.error("required 'wikis' list missing in farmconfig")
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
93 msg = """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
94 Missing required 'wikis' list in 'farmconfig.py'.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
95
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
96 If you run a single wiki you do not need farmconfig.py. Delete it and
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
97 use wikiconfig.py.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
98 """
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
99 raise error.ConfigurationError(msg)
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
100 return _url_re_cache
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
101
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
102
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
103 def _makeConfig(name):
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
104 """ Create and return a config instance
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
105
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
106 Timestamp config with either module mtime or farmconfig mtime. This
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
107 mtime can be used later to invalidate older caches.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
108
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
109 @param name: module name
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
110 @rtype: DefaultConfig sub class instance
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
111 @return: new configuration instance
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
112 """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
113 global _farmconfig_mtime
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
114 try:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
115 module, mtime = _importConfigModule(name)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
116 configClass = getattr(module, 'Config')
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
117 cfg = configClass(name)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
118 cfg.cfg_mtime = max(mtime, _farmconfig_mtime)
3129
d57fed1b0b43 multiconfig: also log which farmconfig we use
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3126
diff changeset
119 logging.info("using wiki config: %s" % os.path.abspath(module.__file__))
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
120 except ImportError, err:
3157
b8cb12fa571b logging: using more logging.exception
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3149
diff changeset
121 logging.exception('Could not import.')
915
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
122 msg = '''ImportError: %(err)s
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
123
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
124 Check that the file is in the same directory as the server script. If
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
125 it is not, you must add the path of the directory where the file is
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
126 located to the python path in the server script. See the comments at
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
127 the top of the server script.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
128
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
129 Check that the configuration file name is either "wikiconfig.py" or the
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
130 module name specified in the wikis list in farmconfig.py. Note that the
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
131 module name does not include the ".py" suffix.
915
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
132 ''' % {
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
133 'err': err,
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
134 }
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
135 raise error.ConfigurationError(msg)
915
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
136 except AttributeError, err:
3157
b8cb12fa571b logging: using more logging.exception
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3149
diff changeset
137 logging.exception('An exception occured.')
915
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
138 msg = '''AttributeError: %(err)s
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
139
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
140 Could not find required "Config" class in "%(name)s.py".
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
141
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
142 This might happen if you are trying to use a pre 1.3 configuration file, or
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
143 made a syntax or spelling error.
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
144
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
145 Another reason for this could be a name clash. It is not possible to have
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
146 config names like e.g. stats.py - because that colides with MoinMoin/stats/ -
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
147 have a look into your MoinMoin code directory what other names are NOT
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
148 possible.
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
149
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
150 Please check your configuration file. As an example for correct syntax,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
151 use the wikiconfig.py file from the distribution.
915
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
152 ''' % {
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
153 'name': name,
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
154 'err': err,
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
155 }
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
156 raise error.ConfigurationError(msg)
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
157
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
158 # postprocess configuration
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
159 # 'setuid' special auth method auth method can log out
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
160 cfg.auth_can_logout = ['setuid']
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
161 cfg.auth_login_inputs = []
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
162 found_names = []
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
163 for auth in cfg.auth:
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
164 if not auth.name:
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
165 raise error.ConfigurationError("Auth methods must have a name.")
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
166 if auth.name in found_names:
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
167 raise error.ConfigurationError("Auth method names must be unique.")
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
168 found_names.append(auth.name)
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
169 if auth.logout_possible and auth.name:
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
170 cfg.auth_can_logout.append(auth.name)
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
171 for input in auth.login_inputs:
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
172 if not input in cfg.auth_login_inputs:
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
173 cfg.auth_login_inputs.append(input)
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
174 cfg.auth_have_login = len(cfg.auth_login_inputs) > 0
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
175
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
176 return cfg
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
177
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
178
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
179 def _getConfigName(url):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
180 """ Return config name for url or raise """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
181 for name, regex in _url_re_list():
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
182 match = regex.match(url)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
183 if match:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
184 return name
1575
45f876b6a109 raise NoConfigMatchedError
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1573
diff changeset
185 raise error.NoConfigMatchedError
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
186
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
187
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
188 def getConfig(url):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
189 """ Return cached config instance for url or create new one
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
190
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
191 If called by many threads in the same time multiple config
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
192 instances might be created. The first created item will be
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
193 returned, using dict.setdefault.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
194
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
195 @param url: the url from request, possibly matching specific wiki
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
196 @rtype: DefaultConfig subclass instance
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
197 @return: config object for specific wiki
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
198 """
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1575
diff changeset
199 cfgName = _getConfigName(url)
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
200 try:
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1575
diff changeset
201 cfg = _config_cache[cfgName]
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
202 except KeyError:
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1575
diff changeset
203 cfg = _makeConfig(cfgName)
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1575
diff changeset
204 cfg = _config_cache.setdefault(cfgName, cfg)
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1575
diff changeset
205 return cfg
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
206
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
207
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
208 # This is a way to mark some text for the gettext tools so that they don't
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
209 # get orphaned. See http://www.python.org/doc/current/lib/node278.html.
1920
b06ef2a53efa 'make pylint', fixed lots of minor stuff found by pylint (and there is still lots left to do)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
210 def _(text):
b06ef2a53efa 'make pylint', fixed lots of minor stuff found by pylint (and there is still lots left to do)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
211 return text
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
212
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
213
1549
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
214 class CacheClass:
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
215 """ just a container for stuff we cache """
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
216 pass
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
217
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
218
3215
f12af017cfd1 fix DefaultConfig to be a new style class (it is using properties!)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3175
diff changeset
219 class DefaultConfig(object):
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
220 """ default config values """
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
221
1597
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
222 # setting DesktopEdition = True gives all local users special powers - ONLY use for MMDE style usage!
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
223 DesktopEdition = False
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
224
729
8e8130a1f46b some cosmetic changes to config/multiconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 718
diff changeset
225 # All acl_rights_* lines must use unicode!
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
226 acl_rights_default = u"Trusted:read,write,delete,revert Known:read,write,delete,revert All:read,write"
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
227 acl_rights_before = u""
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
228 acl_rights_after = u""
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
229 acl_rights_valid = ['read', 'write', 'delete', 'revert', 'admin']
2191
fc90d8319bba Add hierarchical ACLs, clean the module doc string of MoinMoin.security.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2187
diff changeset
230 acl_hierarchic = False
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
231
2799
eab2cd188ca6 added 'xmlrpc' to actions_excluded default value, return Fault if xmlrpc action is excluded
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2795
diff changeset
232 actions_excluded = ['xmlrpc'] # ['DeletePage', 'AttachFile', 'RenamePage', 'test', ]
1513
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
233 allow_xslt = False
3115
cd6cfc715261 replace wikiwikiweb.de by moinmo.in, replace contact Juergen Hermann by Thomas Waldmann, cleanup wikiconfig (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3110
diff changeset
234 antispam_master_url = "http://master.moinmo.in/?action=xmlrpc2"
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
235 auth = [authmodule.MoinLogin()]
2020
1b0629547090 introduce cfg.trusted_auth_methods
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2009
diff changeset
236 # default to http and xmlrpc_applytoken to get old semantics
1b0629547090 introduce cfg.trusted_auth_methods
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2009
diff changeset
237 # xmlrpc_applytoken shall be removed once that code is changed
1b0629547090 introduce cfg.trusted_auth_methods
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2009
diff changeset
238 # to have proper session handling and use request.handle_auth()
2021
927e97ed7d7c fix wrong default for trusted_auth_methods
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2020
diff changeset
239 trusted_auth_methods = ['http', 'xmlrpc_applytoken']
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1984
diff changeset
240 session_handler = session.DefaultSessionHandler()
2912
4be125bafc8a session handling: separate out an extra dimension for persistent IDs
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2799
diff changeset
241 session_id_handler = session.MoinCookieSessionIDHandler()
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
242
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
243 backup_compression = 'gz'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
244 backup_users = []
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
245 backup_include = []
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
246 backup_exclude = [
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
247 r"(.+\.py(c|o)$)",
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
248 r"%(cache_dir)s",
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
249 r"%(/)spages%(/)s.+%(/)scache%(/)s[^%(/)s]+$" % {'/': os.sep},
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
250 r"%(/)s(edit-lock|event-log|\.DS_Store)$" % {'/': os.sep},
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
251 ]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
252 backup_storage_dir = '/tmp'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
253 backup_restore_target_dir = '/tmp'
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
254
1513
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
255 bang_meta = True
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
256 caching_formats = ['text_html']
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
257 changed_time_fmt = '%H:%M'
729
8e8130a1f46b some cosmetic changes to config/multiconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 718
diff changeset
258
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
259 # chars_{upper,lower,digits,spaces} see MoinMoin/util/chartypes.py
729
8e8130a1f46b some cosmetic changes to config/multiconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 718
diff changeset
260
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
261 # if you have gdchart, add something like
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
262 # chart_options = {'width = 720, 'height': 540}
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
263 chart_options = None
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
264
1513
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
265 config_check_enabled = False
770
1c76112a5ff6 removed some unneeded configurability, default value for cfg.cookie_secret
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 751
diff changeset
266
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
267 cookie_domain = None # use '.domain.tld" for a farm with hosts in that domain
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
268 cookie_path = None # use '/wikifarm" for a farm with pathes below that path
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
269 cookie_lifetime = 12 # 12 hours from now
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
270
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
271 data_dir = './data/'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
272 data_underlay_dir = './underlay/'
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
273
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
274 date_fmt = '%Y-%m-%d'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
275 datetime_fmt = '%Y-%m-%d %H:%M:%S'
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
276
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
277 default_markup = 'wiki'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
278 docbook_html_dir = r"/usr/share/xml/docbook/stylesheet/nwalsh/html/" # correct for debian sarge
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
279
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
280 edit_bar = ['Edit', 'Comments', 'Discussion', 'Info', 'Subscribe', 'Quicklink', 'Attachments', 'ActionsMenu']
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
281 editor_default = 'text' # which editor is called when nothing is specified
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
282 editor_ui = 'freechoice' # which editor links are shown on user interface
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
283 editor_force = False
3095
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
284 editor_quickhelp = {
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
285 # editor markup hints quickhelp
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
286 # MUST be in wiki markup, even if the help is not for the wiki parser!
3264
cd28d66afe11 fix quickhelp, needs translation fixes!
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3240
diff changeset
287 'wiki': _(u"""\
2725
388204baf00f change [[macro]] to <<macro>> in all built-in markup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2595
diff changeset
288 Emphasis:: <<Verbatim('')>>''italics''<<Verbatim('')>>; <<Verbatim(''')>>'''bold'''<<Verbatim(''')>>; <<Verbatim(''''')>>'''''bold italics'''''<<Verbatim(''''')>>; <<Verbatim('')>>''mixed ''<<Verbatim(''')>>'''''bold'''<<Verbatim(''')>> and italics''<<Verbatim('')>>; <<Verbatim(----)>> horizontal rule.
3265
bd322703c85e no need to use Verbatim() macro with heading stuff in quickhelp
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3264
diff changeset
289 Headings:: = Title 1 =; == Title 2 ==; === Title 3 ===; ==== Title 4 ====; ===== Title 5 =====.
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
290 Lists:: space and one of: * bullets; 1., a., A., i., I. numbered items; 1.#n start numbering at n; space alone indents.
2725
388204baf00f change [[macro]] to <<macro>> in all built-in markup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2595
diff changeset
291 Links:: <<Verbatim(JoinCapitalizedWords)>>; <<Verbatim([[target|linktext]])>>.
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
292 Tables:: || cell text |||| cell text spanning 2 columns ||; no trailing white space allowed after tables or titles.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
293
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
294 (!) For more help, see HelpOnEditing or SyntaxReference.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
295 """),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
296 'rst': _("""\
3095
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
297 {{{
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
298 Emphasis: *italic* **bold** ``monospace``
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
299
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
300 Headings: Heading 1 Heading 2 Heading 3
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
301 ========= --------- ~~~~~~~~~
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
302
3120
a7c1680aeaa0 PEP8 fixes, mostly whitespace
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3115
diff changeset
303 Horizontal rule: ----
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
304
3120
a7c1680aeaa0 PEP8 fixes, mostly whitespace
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3115
diff changeset
305 Links: TrailingUnderscore_ `multi word with backticks`_ external_
3095
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
306
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
307 .. _external: http://external-site.example.org/foo/
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
308
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
309 Lists: * bullets; 1., a. numbered items.
3095
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
310 }}}
3120
a7c1680aeaa0 PEP8 fixes, mostly whitespace
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3115
diff changeset
311 (!) For more help, see the
3095
cde8093bbb01 fixed the quickhelp shown when editing RST markup (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3092
diff changeset
312 [[http://docutils.sourceforge.net/docs/user/rst/quickref.html|reStructuredText Quick Reference]].
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
313 """),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
314 }
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
315 edit_locking = 'warn 10' # None, 'warn <timeout mins>', 'lock <timeout mins>'
1573
1453513eaa7e use tickets for editing, cfg.edit_ticketing, make tickets more safe, invalidate old tickets
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1557
diff changeset
316 edit_ticketing = True
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
317 edit_rows = 20
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
318
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
319 hacks = {} # { 'feature1': value1, ... }
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
320 # Configuration for features still in development.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
321 # For boolean stuff just use config like this:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
322 # hacks = { 'feature': True, ...}
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
323 # and in the code use:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
324 # if cfg.hacks.get('feature', False): <doit>
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
325 # A non-existing hack key should ever mean False, None, "", [] or {}!
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
326
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
327 hosts_deny = []
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
328
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
329 html_head = ''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
330 html_head_queries = '''<meta name="robots" content="noindex,nofollow">\n'''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
331 html_head_posts = '''<meta name="robots" content="noindex,nofollow">\n'''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
332 html_head_index = '''<meta name="robots" content="index,follow">\n'''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
333 html_head_normal = '''<meta name="robots" content="index,nofollow">\n'''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
334 html_pagetitle = None
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
335
3290
abb32b0af96b revision history: enable the user to get more revisions show by using max_count=123, enable wiki admin to limit that
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3265
diff changeset
336 history_count = (100, 200) # (default_revisions_shown, max_revisions_shown)
abb32b0af96b revision history: enable the user to get more revisions show by using max_count=123, enable wiki admin to limit that
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3265
diff changeset
337
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
338 interwiki_preferred = [] # list of wiki names to show at top of interwiki list
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
339
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
340 language_default = 'en'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
341 language_ignore_browser = False # ignore browser settings, use language_default
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
342 # or user prefs
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
343
3004
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
344 # ldap / active directory server URI
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
345 # use ldaps://server:636 url for ldaps,
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
346 # use ldap://server for ldap without tls (and set ldap_start_tls to 0),
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
347 # use ldap://server for ldap with tls (and set ldap_start_tls to 1 or 2).
2974
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
348 ldap_uri = 'ldap://localhost'
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
349
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
350 # We can either use some fixed user and password for binding to LDAP.
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
351 # Be careful if you need a % char in those strings - as they are used as
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
352 # a format string, you have to write %% to get a single % in the end.
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
353 #ldap_binddn = 'binduser@example.org' # (AD)
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
354 #ldap_binddn = 'cn=admin,dc=example,dc=org' # (OpenLDAP)
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
355 #ldap_bindpw = 'secret'
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
356 # or we can use the username and password we got from the user:
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
357 #ldap_binddn = '%(username)s@example.org' # DN we use for first bind (AD)
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
358 #ldap_bindpw = '%(password)s' # password we use for first bind
3004
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
359 # or we can bind anonymously (if that is supported by your directory).
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
360 # In any case, ldap_binddn and ldap_bindpw must be defined.
2974
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
361 ldap_binddn = ''
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
362 ldap_bindpw = ''
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
363
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
364 # base DN we use for searching
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
365 #ldap_base = 'ou=SOMEUNIT,dc=example,dc=org'
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
366 ldap_base = ''
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
367
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
368 # scope of the search we do (2 == ldap.SCOPE_SUBTREE)
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
369 ldap_scope = 2 # we do not want to import ldap for everybody just for that
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
370
3004
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
371 # LDAP REFERRALS
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
372 ldap_referrals = 0 # (0 needed for AD)
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
373
2974
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
374 # ldap filter used for searching:
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
375 #ldap_filter = '(sAMAccountName=%(username)s)' # (AD)
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
376 ldap_filter = '(uid=%(username)s)' # (OpenLDAP)
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
377 # you can also do more complex filtering like:
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
378 # "(&(cn=%(username)s)(memberOf=CN=WikiUsers,OU=Groups,DC=example,DC=org))"
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
379
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
380 # some attribute names we use to extract information from LDAP:
2977
6fdae05f0eeb ldap auth: set attribute names' default to None (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2974
diff changeset
381 ldap_givenname_attribute = None # ('givenName') ldap attribute we get the first name from
6fdae05f0eeb ldap auth: set attribute names' default to None (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2974
diff changeset
382 ldap_surname_attribute = None # ('sn') ldap attribute we get the family name from
6fdae05f0eeb ldap auth: set attribute names' default to None (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2974
diff changeset
383 ldap_aliasname_attribute = None # ('displayName') ldap attribute we get the aliasname from
6fdae05f0eeb ldap auth: set attribute names' default to None (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2974
diff changeset
384 ldap_email_attribute = None # ('mail') ldap attribute we get the email address from
2985
af66750c66e4 don't overwrite email in userprofile with (empty) email addr from ldap (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2983
diff changeset
385 ldap_email_callback = None # called to make up email address
2977
6fdae05f0eeb ldap auth: set attribute names' default to None (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2974
diff changeset
386
2974
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
387 ldap_coding = 'utf-8' # coding used for ldap queries and result values
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
388 ldap_timeout = 10 # how long we wait for the ldap server [s]
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
389 ldap_verbose = True # if True, put lots of LDAP debug info into the log
bc61a0470fd9 include defaults for ldap auth in multiconfig (default values need review) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2912
diff changeset
390
3004
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
391 # TLS / SSL related defaults
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
392 ldap_start_tls = 0 # 0 = No, 1 = Try, 2 = Required
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
393 ldap_tls_cacertdir = ''
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
394 ldap_tls_cacertfile = ''
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
395 ldap_tls_certfile = ''
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
396 ldap_tls_keyfile = ''
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
397 ldap_tls_require_cert = 0 # 0 == ldap.OPT_X_TLS_NEVER (needed for self-signed certs)
0ae378dc1edf updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2989
diff changeset
398
3097
a94959a2aae7 Some python-ldap packages may not be built with TLS support. Let's
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3095
diff changeset
399 ldap_bindonce = False # set to True to only do one bind. Useful if
a94959a2aae7 Some python-ldap packages may not be built with TLS support. Let's
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3095
diff changeset
400 # configured to bind as the user on the first attempt
a94959a2aae7 Some python-ldap packages may not be built with TLS support. Let's
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3095
diff changeset
401
838
910ed4667859 cfg.log_reverse_dns_lookups = False for disabling reverse dns lookup on networks with broken rdns
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 825
diff changeset
402 log_reverse_dns_lookups = True # if we do reverse dns lookups for logging hostnames
910ed4667859 cfg.log_reverse_dns_lookups = False for disabling reverse dns lookup on networks with broken rdns
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 825
diff changeset
403 # instead of just IPs
2208
2f7f195f4dd2 log timing (using std logging)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2207
diff changeset
404 log_timing = False # update <data_dir>/timing.log?
838
910ed4667859 cfg.log_reverse_dns_lookups = False for disabling reverse dns lookup on networks with broken rdns
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 825
diff changeset
405
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
406 mail_login = None # or "user pwd" if you need to use SMTP AUTH
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
407 mail_sendmail = None # "/usr/sbin/sendmail -t -i" to not use SMTP, but sendmail
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
408 mail_smarthost = None
718
7df204e270ff Mail import - Added support for 8 bit mails, renamed config fields from email_ to mail_import_, added support for DateTime macro, fixed table recognition.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 715
diff changeset
409 mail_from = None # u'Juergen Wiki <noreply@jhwiki.org>'
7df204e270ff Mail import - Added support for 8 bit mails, renamed config fields from email_ to mail_import_, added support for DateTime macro, fixed table recognition.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 715
diff changeset
410
7df204e270ff Mail import - Added support for 8 bit mails, renamed config fields from email_ to mail_import_, added support for DateTime macro, fixed table recognition.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 715
diff changeset
411 mail_import_subpage_template = u"$from-$date-$subject" # used for mail import
1687
1d358ccc0f2f mail_import_pagename_search determines where and in which order to look for target pagename
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1684
diff changeset
412 mail_import_pagename_search = ['subject', 'to', ] # where to look for target pagename (and in which order)
1615
9fa2ec252d1f mailimport: add envelope feature for target page spec
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1597
diff changeset
413 mail_import_pagename_envelope = u"%s" # use u"+ %s/" to add "+ " and "/" automatically
2726
6cb75379c073 change ["free link"] to [[free link]] in all built-in markup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2725
diff changeset
414 mail_import_pagename_regex = r'\[\[([^\]]*)\]\]' # how to find/extract the pagename from the subject
1658
0dee8ba737af mailimport: allow multiple wiki email addrs
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1654
diff changeset
415 mail_import_wiki_addrs = [] # the e-mail addresses for e-mails that should go into the wiki
718
7df204e270ff Mail import - Added support for 8 bit mails, renamed config fields from email_ to mail_import_, added support for DateTime macro, fixed table recognition.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 715
diff changeset
416 mail_import_secret = ""
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
417
1548
2eb5117aa7de content-disposition for AttachFile downloads either inline or attachment depending on mimetype in cfg.mimetypes_xss_protect list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1513
diff changeset
418 # some dangerous mimetypes (we don't use "content-disposition: inline" for them when a user
2eb5117aa7de content-disposition for AttachFile downloads either inline or attachment depending on mimetype in cfg.mimetypes_xss_protect list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1513
diff changeset
419 # downloads such attachments, because the browser might execute e.g. Javascript contained
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
420 # in the HTML and steal your moin cookie or do other nasty stuff)
1548
2eb5117aa7de content-disposition for AttachFile downloads either inline or attachment depending on mimetype in cfg.mimetypes_xss_protect list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1513
diff changeset
421 mimetypes_xss_protect = [
2eb5117aa7de content-disposition for AttachFile downloads either inline or attachment depending on mimetype in cfg.mimetypes_xss_protect list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1513
diff changeset
422 'text/html',
2eb5117aa7de content-disposition for AttachFile downloads either inline or attachment depending on mimetype in cfg.mimetypes_xss_protect list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1513
diff changeset
423 'application/x-shockwave-flash',
1555
0eaaba71dfc0 Added XHTML to the unsafe list. Backport necessary.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1552
diff changeset
424 'application/xhtml+xml',
1548
2eb5117aa7de content-disposition for AttachFile downloads either inline or attachment depending on mimetype in cfg.mimetypes_xss_protect list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1513
diff changeset
425 ]
2eb5117aa7de content-disposition for AttachFile downloads either inline or attachment depending on mimetype in cfg.mimetypes_xss_protect list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1513
diff changeset
426
1978
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
427 mimetypes_embed = [
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
428 'application/x-dvi',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
429 'application/postscript',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
430 'application/pdf',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
431 'application/ogg',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
432 'application/vnd.visio',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
433 'image/x-ms-bmp',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
434 'image/svg+xml',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
435 'image/tiff',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
436 'image/x-photoshop',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
437 'audio/mpeg',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
438 'audio/midi',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
439 'audio/x-wav',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
440 'video/fli',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
441 'video/mpeg',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
442 'video/quicktime',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
443 'video/x-msvideo',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
444 'chemical/x-pdb',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
445 'x-world/x-vrml',
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
446 ]
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
447
f6262ee86e0b EmbedObject: make mimetypes configurable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1977
diff changeset
448
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
449 navi_bar = [u'RecentChanges', u'FindPage', u'HelpContents', ]
1513
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
450 nonexist_qm = False
2160
7c8ee12f8c1d Fix an error with missing bot_host attribute. Use more descriptive names.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2152
diff changeset
451 notification_bot_uri = None
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
452
3144
7aba52041f56 add OpenID provider code
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3129
diff changeset
453 # OpenID server support
7aba52041f56 add OpenID provider code
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3129
diff changeset
454 openid_server_enabled = False
7aba52041f56 add OpenID provider code
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3129
diff changeset
455 openid_server_restricted_users_group = None
7aba52041f56 add OpenID provider code
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3129
diff changeset
456 openid_server_enable_user = False
7aba52041f56 add OpenID provider code
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3129
diff changeset
457
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
458 page_credits = [
2227
c8ff348927db credits: slowly moving to moinmo.in
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2220
diff changeset
459 # Feel free to add other credits, but PLEASE do NOT change or remove
c8ff348927db credits: slowly moving to moinmo.in
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2220
diff changeset
460 # the following links - you help us by keeping them "as is":
3115
cd6cfc715261 replace wikiwikiweb.de by moinmo.in, replace contact Juergen Hermann by Thomas Waldmann, cleanup wikiconfig (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3110
diff changeset
461 '<a href="http://moinmo.in/" title="This site uses the MoinMoin Wiki software.">MoinMoin Powered</a>',
2227
c8ff348927db credits: slowly moving to moinmo.in
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2220
diff changeset
462 '<a href="http://moinmo.in/Python" title="MoinMoin is written in Python.">Python Powered</a>',
2193
cb913c851e91 credits: added title attr, added some comments, added GPL credit
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2191
diff changeset
463
cb913c851e91 credits: added title attr, added some comments, added GPL credit
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2191
diff changeset
464 # Optional credits:
2227
c8ff348927db credits: slowly moving to moinmo.in
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2220
diff changeset
465 # if you think it can be maybe misunderstood as applying to content or topic of your wiki,
2193
cb913c851e91 credits: added title attr, added some comments, added GPL credit
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2191
diff changeset
466 # feel free to remove this one:
2227
c8ff348927db credits: slowly moving to moinmo.in
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2220
diff changeset
467 '<a href="http://moinmo.in/GPL" title="MoinMoin is GPL licensed.">GPL licensed</a>',
c8ff348927db credits: slowly moving to moinmo.in
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2220
diff changeset
468
2193
cb913c851e91 credits: added title attr, added some comments, added GPL credit
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2191
diff changeset
469 # if you don't need/want to check the html output, feel free to remove this one:
cb913c851e91 credits: added title attr, added some comments, added GPL credit
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2191
diff changeset
470 '<a href="http://validator.w3.org/check?uri=referer" title="Click here to validate this page.">Valid HTML 4.01</a>',
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
471 ]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
472 page_footer1 = ''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
473 page_footer2 = ''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
474
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
475 page_header1 = ''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
476 page_header2 = ''
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
477
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
478 page_front_page = u'HelpOnLanguages' # this will make people choose a sane config
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
479 page_local_spelling_words = u'LocalSpellingWords'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
480 page_category_regex = u'^Category[A-Z]'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
481 page_dict_regex = u'[a-z0-9]Dict$'
1774
b57dacec0ce3 multiconfig:page_group_regex reverted to CamelCase definition.
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1773
diff changeset
482 page_group_regex = u'[a-z0-9]Group$'
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
483 page_template_regex = u'[a-z0-9]Template$'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
484
1513
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
485 page_license_enabled = False
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
486 page_license_page = u'WikiLicense'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
487
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
488 # These icons will show in this order in the iconbar, unless they
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
489 # are not relevant, e.g email icon when the wiki is not configured
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
490 # for email.
1684
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
491 page_iconbar = ["edit", "view", "diff", "info", "subscribe", "raw", "print", ]
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
492
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
493 # Standard buttons in the iconbar
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
494 page_icons_table = {
1684
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
495 # key querystr dict, title, icon-key
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
496 'diff': ({'action': 'diff'}, _("Diffs"), "diff"),
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
497 'info': ({'action': 'info'}, _("Info"), "info"),
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
498 'edit': ({'action': 'edit'}, _("Edit"), "edit"),
3083
f2564609f601 fix classic theme's unsubscribe icon's action link
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3050
diff changeset
499 'unsubscribe': ({'action': 'unsubscribe'}, _("UnSubscribe"), "unsubscribe"),
1684
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
500 'subscribe': ({'action': 'subscribe'}, _("Subscribe"), "subscribe"),
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
501 'raw': ({'action': 'raw'}, _("Raw"), "raw"),
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
502 'xml': ({'action': 'show', 'mimetype': 'text/xml'}, _("XML"), "xml"),
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
503 'print': ({'action': 'print'}, _("Print"), "print"),
aadc8b0e11cf change classic theme to propagate rev, too
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1658
diff changeset
504 'view': ({}, _("View"), "view"),
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
505 }
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
506
2431
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
507
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
508 def password_checker(username, password):
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
509 """ Check if a password is secure enough.
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
510 First (and in any case), we use a built-in check to get rid of the
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
511 worst passwords. If there is cracklib installed, we use it for
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
512 additional checks.
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
513 If you don't want to check passwords, use password_checker = None.
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
514
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
515 @return: None if there is no problem with the password,
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
516 some string with an error msg, if the password is problematic.
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
517 """
2491
41669a7a60ad Import set if it's unknown (python 2.3 compatibility)
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2447
diff changeset
518
41669a7a60ad Import set if it's unknown (python 2.3 compatibility)
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2447
diff changeset
519 try:
2431
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
520 # in any case, do a very simple built-in check to avoid the worst passwords
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
521 if len(password) < 6:
2443
b4c44e5be9e8 password_checker: more builtin checks, more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2432
diff changeset
522 raise ValueError("Password too short.")
b4c44e5be9e8 password_checker: more builtin checks, more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2432
diff changeset
523 if len(set(password)) < 4:
b4c44e5be9e8 password_checker: more builtin checks, more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2432
diff changeset
524 raise ValueError("Password has not enough different characters.")
2431
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
525
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
526 username_lower = username.lower()
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
527 password_lower = password.lower()
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
528 if username in password or password in username or \
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
529 username_lower in password_lower or password_lower in username_lower:
2443
b4c44e5be9e8 password_checker: more builtin checks, more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2432
diff changeset
530 raise ValueError("Password too easy (containment).")
2431
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
531
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
532 keyboards = (ur"`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./", # US kbd
2443
b4c44e5be9e8 password_checker: more builtin checks, more tests
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2432
diff changeset
533 ur"^1234567890ß´qwertzuiopü+asdfghjklöä#yxcvbnm,.-", # german kbd
2431
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
534 ) # add more keyboards!
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
535 for kbd in keyboards:
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
536 rev_kbd = kbd[::-1]
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
537 if password in kbd or password in rev_kbd or \
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
538 password_lower in kbd or password_lower in rev_kbd:
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
539 raise ValueError("Password too easy (kbd sequence)")
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
540 try:
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
541 # to use advanced checking, you need to install python-crack,
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
542 # cracklib-runtime (dict processing) and do not forget to
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
543 # initialize the crack dicts!
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
544 import crack
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
545 # instead of some "old password" we give the username to check
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
546 # whether the password is too similar to the username
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
547 crack.VeryFascistCheck(password, username) # raises ValueError on bad passwords
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
548 except ImportError:
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
549 pass
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
550 return None
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
551 except ValueError, err:
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
552 return str(err)
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
553
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
554 password_checker = staticmethod(password_checker)
58260d360f5c password_checker (simple builtin test, optionally using python-crack lib)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2426
diff changeset
555
1689
7b80735ede14 quicklinks_default and subscribed_pages_default to preload the lists in the user profile
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1688
diff changeset
556 quicklinks_default = [] # preload user quicklinks with this page list
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
557 refresh = None # (minimum_delay, type), e.g.: (2, 'internal')
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
558 rss_cache = 60 # suggested caching time for RecentChanges RSS, in seconds
1959
7ccf35e8f674 use a list to have defined order for cfg.sistersites (e.g. in theme output)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1955
diff changeset
559 sistersites = [
7ccf35e8f674 use a list to have defined order for cfg.sistersites (e.g. in theme output)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1955
diff changeset
560 #('Self', 'http://localhost:8080/?action=sisterpages'),
2187
15c11fe8f6b2 config/multiconfig: minor cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2160
diff changeset
561 #('EmacsWiki', 'http://www.emacswiki.org/cgi-bin/test?action=sisterpages'),
15c11fe8f6b2 config/multiconfig: minor cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2160
diff changeset
562 #('JspWiki', 'http://www.jspwiki.org/SisterSites.jsp'),
1959
7ccf35e8f674 use a list to have defined order for cfg.sistersites (e.g. in theme output)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1955
diff changeset
563 ] # list of (sistersitename, sisterpagelistfetchurl)
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
564 shared_intermap = None # can be string or list of strings (filenames)
1513
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
565 show_hosts = True
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
566 show_interwiki = False
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
567 show_names = True
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
568 show_section_numbers = 0
1513
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
569 show_timings = False
4298764e3cef use booleans instead of 0/1 in configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1510
diff changeset
570 show_version = False
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
571 siteid = 'default'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
572 stylesheets = [] # list of tuples (media, csshref) to insert after theme css, before user css
2307
fe37834deb3d Move a list of event handlers and subscribable events to config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2227
diff changeset
573 _subscribable_events = None # A list of event types that user can subscribe to
1689
7b80735ede14 quicklinks_default and subscribed_pages_default to preload the lists in the user profile
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1688
diff changeset
574 subscribed_pages_default = [] # preload user subscribed pages with this page list
2429
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
575 email_subscribed_events_default = [
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
576 PageChangedEvent.__name__,
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
577 PageRenamedEvent.__name__,
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
578 PageDeletedEvent.__name__,
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
579 PageCopiedEvent.__name__,
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
580 PageRevertedEvent.__name__,
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
581 FileAttachedEvent.__name__,
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
582 ]
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
583 jabber_subscribed_events_default = []
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
584 superuser = [] # list of unicode user names that have super powers :)
1731
d4a424079d50 multiconfig: definition of supplementation_page = False, supplementation_page_name = u'Discussion', supplementation_page_template = u'DiscussionTemplate'
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1691
diff changeset
585 supplementation_page = False
d4a424079d50 multiconfig: definition of supplementation_page = False, supplementation_page_name = u'Discussion', supplementation_page_template = u'DiscussionTemplate'
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1691
diff changeset
586 supplementation_page_name = u'Discussion'
d4a424079d50 multiconfig: definition of supplementation_page = False, supplementation_page_name = u'Discussion', supplementation_page_template = u'DiscussionTemplate'
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1691
diff changeset
587 supplementation_page_template = u'DiscussionTemplate'
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
588 surge_action_limits = {# allow max. <count> <action> requests per <dt> secs
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
589 # action: (count, dt)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
590 'all': (30, 30),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
591 'show': (30, 60),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
592 'recall': (5, 60),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
593 'raw': (20, 40), # some people use this for css
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
594 'AttachFile': (90, 60),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
595 'diff': (30, 60),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
596 'fullsearch': (5, 60),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
597 'edit': (10, 120),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
598 'rss_rc': (1, 60),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
599 'default': (30, 60),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
600 }
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
601 surge_lockout_time = 3600 # secs you get locked out when you ignore warnings
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
602
2983
7b0aadb97d01 new antispam stuff: textchas (text CAPTCHAs), cleanup AttachFile handler (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2977
diff changeset
603 textchas = None
7b0aadb97d01 new antispam stuff: textchas (text CAPTCHAs), cleanup AttachFile handler (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2977
diff changeset
604 textchas_disabled_group = None # e.g. u'NoTextChasGroup' if you are a member of this group, you don't get textchas
7b0aadb97d01 new antispam stuff: textchas (text CAPTCHAs), cleanup AttachFile handler (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2977
diff changeset
605
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
606 theme_default = 'modern'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
607 theme_force = False
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
608
2205
cfc1595e53dc cfg.traceback_show (show tracebacks on the web) and cfg.traceback_log_dir (directory to dump tracebacks to - ported from 1.5 repo)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2193
diff changeset
609 traceback_show = 1
cfc1595e53dc cfg.traceback_show (show tracebacks on the web) and cfg.traceback_log_dir (directory to dump tracebacks to - ported from 1.5 repo)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2193
diff changeset
610 traceback_log_dir = None
cfc1595e53dc cfg.traceback_show (show tracebacks on the web) and cfg.traceback_log_dir (directory to dump tracebacks to - ported from 1.5 repo)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2193
diff changeset
611
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
612 trail_size = 5
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
613 tz_offset = 0.0 # default time zone offset in hours from UTC
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
614
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
615 user_autocreate = False # do we auto-create user profiles
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
616 user_email_unique = True # do we check whether a user's email is unique?
2091
7af58454aafa Send an event when user changes her jabber id, force jid to be unique.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2072
diff changeset
617 user_jid_unique = True # do we check whether a user's email is unique?
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
618
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
619 # a regex of HTTP_USER_AGENTS that should be excluded from logging
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
620 # and receive a FORBIDDEN for anything except viewing a page
3092
e3846a8e4bd5 remove 'java' from spider regex to fix saving twikidraw drawings (thanks to Ernestas Liubarskij)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3083
diff changeset
621 # list must not contain 'java' because of twikidraw wanting to save drawing uses this useragent
3012
ca0bf3aefa0f added more user agents to the spider list (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3004
diff changeset
622 ua_spiders = ('archiver|cfetch|charlotte|crawler|curl|gigabot|googlebot|heritrix|holmes|htdig|httrack|httpunit|'
3092
e3846a8e4bd5 remove 'java' from spider regex to fix saving twikidraw drawings (thanks to Ernestas Liubarskij)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3083
diff changeset
623 'intelix|jeeves|larbin|leech|libwww-perl|linkbot|linkmap|linkwalk|litefinder|mercator|'
3012
ca0bf3aefa0f added more user agents to the spider list (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3004
diff changeset
624 'microsoft.url.control|mirror| mj12bot|msnbot|msrbot|neomo|nutbot|omniexplorer|puf|robot|scooter|seekbot|'
ca0bf3aefa0f added more user agents to the spider list (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3004
diff changeset
625 'sherlock|slurp|sitecheck|snoopy|spider|teleport|twiceler|voilabot|voyager|webreaper|wget|yeti')
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
626
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
627 # Wiki identity
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
628 sitename = u'Untitled Wiki'
1318
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
629
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
630 # url_prefix is DEPRECATED and not used any more by the code.
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
631 # it confused many people by its name and default value of '/wiki' to the
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
632 # wrong conclusion that it is the url of the wiki (the dynamic) stuff,
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
633 # but it was used to address the static stuff (images, css, js).
1799
06ce4843b9b5 remove some XXX strings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1791
diff changeset
634 # Thus we use the more clear url_prefix_static ['/moin_staticVVV'] setting now.
1318
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
635 # For a limited time, we still look at url_prefix - if it is not None, we
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
636 # copy the value to url_prefix_static to ease transition.
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
637 url_prefix = None
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
638
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1575
diff changeset
639 # includes the moin version number, so we can have a unlimited cache lifetime
1318
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
640 # for the static stuff. if stuff changes on version upgrade, url will change
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
641 # immediately and we have no problem with stale caches.
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1575
diff changeset
642 url_prefix_static = config.url_prefix_static
1654
2a1f570ea6d4 cfg.url_prefix_local for stuff that needs to be loaded from same-site to work correctly (e.g. FCKeditor - ported from 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1624
diff changeset
643 url_prefix_local = None # if None, use same value as url_prefix_static.
2a1f570ea6d4 cfg.url_prefix_local for stuff that needs to be loaded from same-site to work correctly (e.g. FCKeditor - ported from 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1624
diff changeset
644 # must be same site as wiki engine (for e.g. JS permissions)
1318
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
645
1417
76cd1916b7e4 Changed the default value of url_prefix_action to None to get the old behaviour with nicer URLs. Documented this in CHANGES.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1397
diff changeset
646 # we could prefix actions to be able to exclude them by robots.txt:
76cd1916b7e4 Changed the default value of url_prefix_action to None to get the old behaviour with nicer URLs. Documented this in CHANGES.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1397
diff changeset
647 #url_prefix_action = 'action' # no leading or trailing '/'
76cd1916b7e4 Changed the default value of url_prefix_action to None to get the old behaviour with nicer URLs. Documented this in CHANGES.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1397
diff changeset
648 url_prefix_action = None # compatiblity
1318
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
649
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
650 logo_string = None
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
651 interwikiname = None
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
652
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
653 url_mappings = {}
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
654
2306
5cf429e40f18 allow disabling certain userprefs plugins from config
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2286
diff changeset
655 # allow disabling certain userpreferences plugins
5cf429e40f18 allow disabling certain userprefs plugins from config
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2286
diff changeset
656 disabled_userprefs = []
5cf429e40f18 allow disabling certain userprefs plugins from config
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2286
diff changeset
657
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
658 user_checkbox_fields = [
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
659 ('mailto_author', lambda _: _('Publish my email (not my wiki homepage) in author info')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
660 ('edit_on_doubleclick', lambda _: _('Open editor on double click')),
877
9bb19e35d5a8 changed wording, as we don't jump to frontpage any more
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 859
diff changeset
661 ('remember_last_visit', lambda _: _('After login, jump to last visited page')),
1752
6f8360e1a4bb wrapping div support for wiki parser, toggling display of comment divs, show_comments user prefs
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1741
diff changeset
662 ('show_comments', lambda _: _('Show comment sections')),
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
663 ('show_nonexist_qm', lambda _: _('Show question mark for non-existing pagelinks')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
664 ('show_page_trail', lambda _: _('Show page trail')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
665 ('show_toolbar', lambda _: _('Show icon toolbar')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
666 ('show_topbottom', lambda _: _('Show top/bottom links in headings')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
667 ('show_fancy_diff', lambda _: _('Show fancy diffs')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
668 ('wikiname_add_spaces', lambda _: _('Add spaces to displayed wiki names')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
669 ('remember_me', lambda _: _('Remember login information')),
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
670
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
671 ('disabled', lambda _: _('Disable this account forever')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
672 # if an account is disabled, it may be used for looking up
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
673 # id -> username for page info and recent changes, but it
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
674 # is not usable for the user any more:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
675 ]
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
676
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
677 user_checkbox_defaults = {'mailto_author': 0,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
678 'edit_on_doubleclick': 0,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
679 'remember_last_visit': 0,
1977
abcbc20e8f8f raise unzip_attachments_count to 101, some other minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1959
diff changeset
680 'show_comments': 0,
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
681 'show_nonexist_qm': nonexist_qm,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
682 'show_page_trail': 1,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
683 'show_toolbar': 1,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
684 'show_topbottom': 0,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
685 'show_fancy_diff': 1,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
686 'wikiname_add_spaces': 0,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
687 'remember_me': 1,
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
688 }
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
689
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
690 # don't let the user change those
2429
0cd1152b8da5 default to email notification of all events to ease migration from old scheme
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2426
diff changeset
691 # user_checkbox_disable = ['disabled']
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
692 user_checkbox_disable = []
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
693
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
694 # remove those checkboxes:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
695 #user_checkbox_remove = ['edit_on_doubleclick', 'show_nonexist_qm', 'show_toolbar', 'show_topbottom',
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
696 # 'show_fancy_diff', 'wikiname_add_spaces', 'remember_me', 'disabled',]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
697 user_checkbox_remove = []
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
698
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
699 user_form_fields = [
3050
f0250b5a6982 fix small i18n issues (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3012
diff changeset
700 ('name', _('Name'), "text", "36", _("(Use FirstnameLastname)")),
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
701 ('aliasname', _('Alias-Name'), "text", "36", ''),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
702 ('email', _('Email'), "text", "36", ''),
2072
d347a0303be1 Add JID field and a button to send account details with Jabber to user preferences.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2021
diff changeset
703 ('jid', _('Jabber ID'), "text", "36", ''),
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
704 ('css_url', _('User CSS URL'), "text", "40", _('(Leave it empty for disabling user CSS)')),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
705 ('edit_rows', _('Editor size'), "text", "3", ''),
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
706 ]
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
707
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
708 user_form_defaults = {# key: default - do NOT remove keys from here!
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
709 'name': '',
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
710 'aliasname': '',
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
711 'password': '',
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
712 'password2': '',
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
713 'email': '',
2072
d347a0303be1 Add JID field and a button to send account details with Jabber to user preferences.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2021
diff changeset
714 'jid': '',
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
715 'css_url': '',
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
716 'edit_rows': "20",
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
717 }
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
718
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
719 # don't let the user change those, but show them:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
720 #user_form_disable = ['name', 'aliasname', 'email',]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
721 user_form_disable = []
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
722
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
723 # remove those completely:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
724 #user_form_remove = ['password', 'password2', 'css_url', 'logout', 'create', 'account_sendmail',]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
725 user_form_remove = []
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
726
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
727 # attributes we do NOT save to the userpref file
2020
1b0629547090 introduce cfg.trusted_auth_methods
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2009
diff changeset
728 user_transient_fields = ['id', 'valid', 'may', 'auth_username', 'password', 'password2', 'auth_method', 'auth_attribs', ]
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
729
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
730 user_homewiki = 'Self' # interwiki name for where user homepages are located
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
731
2447
45641cbe7729 enable new PEP8 test, fixes where it failed
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2443
diff changeset
732 unzip_single_file_size = 2.0 * 1000 ** 2
45641cbe7729 enable new PEP8 test, fixes where it failed
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2443
diff changeset
733 unzip_attachments_space = 200.0 * 1000 ** 2
1977
abcbc20e8f8f raise unzip_attachments_count to 101, some other minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1959
diff changeset
734 unzip_attachments_count = 101 # 1 zip file + 100 files contained in it
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
735
2989
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
736 xapian_search = False
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
737 xapian_index_dir = None
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
738 xapian_stemming = True
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
739 xapian_index_history = False
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
740 search_results_per_page = 10
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
741
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
742 SecurityPolicy = None
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
743
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
744 def __init__(self, siteid):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
745 """ Init Config instance """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
746 self.siteid = siteid
1549
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
747 self.cache = CacheClass()
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
748
1624
0b0b94e1680f cache pagelist using new cache mechanism
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1620
diff changeset
749 from MoinMoin.Page import ItemCache
0b0b94e1680f cache pagelist using new cache mechanism
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1620
diff changeset
750 self.cache.meta = ItemCache('meta')
0b0b94e1680f cache pagelist using new cache mechanism
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1620
diff changeset
751 self.cache.pagelists = ItemCache('pagelists')
1620
a86f20280204 implement and use ItemMetaDataCache
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1615
diff changeset
752
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
753 if self.config_check_enabled:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
754 self._config_check()
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
755
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
756 # define directories
1011
58f5af49cd03 move config and multiconfig to config/ package, see HINT in CHANGES
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 932
diff changeset
757 self.moinmoin_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
758 data_dir = os.path.normpath(self.data_dir)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
759 self.data_dir = data_dir
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
760 for dirname in ('user', 'cache', 'plugin'):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
761 name = dirname + '_dir'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
762 if not getattr(self, name, None):
1929
aa6aa944246b introduce per-user and per-session secrets that are used for the cookie
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1920
diff changeset
763 setattr(self, name, os.path.abspath(os.path.join(data_dir, dirname)))
855
481c72d4a181 support for common indices directory cfg.xapian_index_dir
Franz Pletz <fpletz AT franz-pletz DOT org>
parents: 838
diff changeset
764
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
765 # Try to decode certain names which allow unicode
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
766 self._decode()
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
767
1549
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
768 # After that, pre-compile some regexes
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
769 self.cache.page_category_regex = re.compile(self.page_category_regex, re.UNICODE)
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
770 self.cache.page_dict_regex = re.compile(self.page_dict_regex, re.UNICODE)
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
771 self.cache.page_group_regex = re.compile(self.page_group_regex, re.UNICODE)
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
772 self.cache.page_template_regex = re.compile(self.page_template_regex, re.UNICODE)
1557
60067807cf9a Allow empty strings for ua_spiders.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1555
diff changeset
773 self.cache.ua_spiders = self.ua_spiders and re.compile(self.ua_spiders, re.I)
1549
e36313297589 introduce request.cfg.cache object, start using it for some precompiled regexes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1548
diff changeset
774
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
775 self._check_directories()
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
776
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
777 if not isinstance(self.superuser, list):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
778 msg = """The superuser setting in your wiki configuration is not a list
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
779 (e.g. ['Sample User', 'AnotherUser']).
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
780 Please change it in your wiki configuration and try again."""
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
781 raise error.ConfigurationError(msg)
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
782
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
783 self._loadPluginModule()
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
784
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
785 # Preparse user dicts
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
786 self._fillDicts()
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
787
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
788 # Normalize values
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
789 self.language_default = self.language_default.lower()
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
790
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
791 # Use site name as default name-logo
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
792 if self.logo_string is None:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
793 self.logo_string = self.sitename
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
794
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
795 # Check for needed modules
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
796
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
797 # FIXME: maybe we should do this check later, just before a
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
798 # chart is needed, maybe in the chart module, instead doing it
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
799 # for each request. But this require a large refactoring of
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
800 # current code.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
801 if self.chart_options:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
802 try:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
803 import gdchart
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
804 except ImportError:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
805 self.chart_options = None
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
806
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
807 # post process
2430
c7bb078d3318 commit b8b87daf7cc4 broke farms because one dict was shared, fix it
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2429
diff changeset
808
c7bb078d3318 commit b8b87daf7cc4 broke farms because one dict was shared, fix it
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2429
diff changeset
809 # internal dict for plugin `modules' lists
c7bb078d3318 commit b8b87daf7cc4 broke farms because one dict was shared, fix it
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2429
diff changeset
810 self._site_plugin_lists = {}
c7bb078d3318 commit b8b87daf7cc4 broke farms because one dict was shared, fix it
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2429
diff changeset
811
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
812 # we replace any string placeholders with config values
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
813 # e.g u'%(page_front_page)s' % self
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
814 self.navi_bar = [elem % self for elem in self.navi_bar]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
815 self.backup_exclude = [elem % self for elem in self.backup_exclude]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
816
2989
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
817 # check if python-xapian is installed
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
818 if self.xapian_search:
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
819 try:
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
820 import xapian
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
821 except ImportError, err:
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
822 self.xapian_search = False
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
823 logging.error("xapian_search was auto-disabled because python-xapian is not installed [%s]." % str(err))
c678e73b7730 auto-disable xapian_search when xapian fails to import (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2985
diff changeset
824
788
4840926790f5 indexed search: added Xapian support (needs more work), removed Lupy support
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 528
diff changeset
825 # list to cache xapian searcher objects
4840926790f5 indexed search: added Xapian support (needs more work), removed Lupy support
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 528
diff changeset
826 self.xapian_searchers = []
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
827
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
828 # check if mail is possible and set flag:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
829 self.mail_enabled = (self.mail_smarthost is not None or self.mail_sendmail is not None) and self.mail_from
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
830
2072
d347a0303be1 Add JID field and a button to send account details with Jabber to user preferences.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2021
diff changeset
831 # check if jabber bot is available and set flag:
2160
7c8ee12f8c1d Fix an error with missing bot_host attribute. Use more descriptive names.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2152
diff changeset
832 self.jabber_enabled = self.notification_bot_uri is not None
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
833
2147
b01a6ef1be4c Get rid of the global xmlrpc Server object. Instantiate one in config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2091
diff changeset
834 # if we are to use the jabber bot, instantiate a server object for future use
b01a6ef1be4c Get rid of the global xmlrpc Server object. Instantiate one in config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2091
diff changeset
835 if self.jabber_enabled:
2336
10be78f1fa97 Merge main.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2331 2286
diff changeset
836
2331
493565b060ff Raise exception if notifications are enabled but no secret is set.
Karol Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2324
diff changeset
837 errmsg = "You must set a (long) secret string to send notifications!"
493565b060ff Raise exception if notifications are enabled but no secret is set.
Karol Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2324
diff changeset
838 try:
493565b060ff Raise exception if notifications are enabled but no secret is set.
Karol Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2324
diff changeset
839 if not self.secret:
493565b060ff Raise exception if notifications are enabled but no secret is set.
Karol Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2324
diff changeset
840 raise error.ConfigurationError(errmsg)
493565b060ff Raise exception if notifications are enabled but no secret is set.
Karol Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2324
diff changeset
841 except AttributeError, err:
3175
2a3a6cb34e45 pylint findings: fix some harmless stuff
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3157
diff changeset
842 raise error.ConfigurationError(errmsg)
2336
10be78f1fa97 Merge main.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2331 2286
diff changeset
843
2147
b01a6ef1be4c Get rid of the global xmlrpc Server object. Instantiate one in config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2091
diff changeset
844 from xmlrpclib import Server
2160
7c8ee12f8c1d Fix an error with missing bot_host attribute. Use more descriptive names.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2152
diff changeset
845 self.notification_server = Server(self.notification_bot_uri, )
1080
f8ba3b0ca9f4 Use the meta dict instead of a distinct file for the IWID.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1053
diff changeset
846
1118
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
847 # Cache variables for the properties below
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
848 self._iwid = self._iwid_full = self._meta_dict = None
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
849
1552
f9639ed07af2 using request.cfg.cache more
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1549
diff changeset
850 self.cache.acl_rights_before = AccessControlList(self, [self.acl_rights_before])
f9639ed07af2 using request.cfg.cache more
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1549
diff changeset
851 self.cache.acl_rights_default = AccessControlList(self, [self.acl_rights_default])
f9639ed07af2 using request.cfg.cache more
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1549
diff changeset
852 self.cache.acl_rights_after = AccessControlList(self, [self.acl_rights_after])
1276
7c29a18a7e26 more memory efficient and faster ACL processing, do not have before/after/default acl in ACL object, but only once in cfg
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1212
diff changeset
853
1318
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
854 if self.url_prefix is not None: # remove this code when url_prefix setting is removed
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
855 self.url_prefix_static = self.url_prefix
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1276
diff changeset
856
1339
544b931cd965 new setting url_prefix_action, cleanup page.url/link_to, wikiutil.link_tag
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
857 action_prefix = self.url_prefix_action
544b931cd965 new setting url_prefix_action, cleanup page.url/link_to, wikiutil.link_tag
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
858 if action_prefix is not None and action_prefix.endswith('/'): # make sure there is no trailing '/'
544b931cd965 new setting url_prefix_action, cleanup page.url/link_to, wikiutil.link_tag
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
859 self.url_prefix_action = action_prefix[:-1]
544b931cd965 new setting url_prefix_action, cleanup page.url/link_to, wikiutil.link_tag
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
860
1654
2a1f570ea6d4 cfg.url_prefix_local for stuff that needs to be loaded from same-site to work correctly (e.g. FCKeditor - ported from 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1624
diff changeset
861 if self.url_prefix_local is None:
2a1f570ea6d4 cfg.url_prefix_local for stuff that needs to be loaded from same-site to work correctly (e.g. FCKeditor - ported from 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1624
diff changeset
862 self.url_prefix_local = self.url_prefix_static
2a1f570ea6d4 cfg.url_prefix_local for stuff that needs to be loaded from same-site to work correctly (e.g. FCKeditor - ported from 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1624
diff changeset
863
2a1f570ea6d4 cfg.url_prefix_local for stuff that needs to be loaded from same-site to work correctly (e.g. FCKeditor - ported from 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1624
diff changeset
864
1118
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
865 def load_meta_dict(self):
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
866 """ The meta_dict contains meta data about the wiki instance. """
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
867 if getattr(self, "_meta_dict", None) is None:
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
868 self._meta_dict = wikiutil.MetaDict(os.path.join(self.data_dir, 'meta'), self.cache_dir)
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
869 return self._meta_dict
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
870 meta_dict = property(load_meta_dict)
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
871
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
872 # lazily load iwid(_full)
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
873 def make_iwid_property(attr):
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
874 def getter(self):
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
875 if getattr(self, attr, None) is None:
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
876 self.load_IWID()
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
877 return getattr(self, attr)
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
878 return property(getter)
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
879 iwid = make_iwid_property("_iwid")
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
880 iwid_full = make_iwid_property("_iwid_full")
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
881
2307
fe37834deb3d Move a list of event handlers and subscribable events to config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2227
diff changeset
882 # lazily load a list of events a user can subscribe to
fe37834deb3d Move a list of event handlers and subscribable events to config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2227
diff changeset
883 def make_subscribable_events_prop():
fe37834deb3d Move a list of event handlers and subscribable events to config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2227
diff changeset
884 def getter(self):
fe37834deb3d Move a list of event handlers and subscribable events to config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2227
diff changeset
885 if getattr(self, "_subscribable_events", None) is None:
fe37834deb3d Move a list of event handlers and subscribable events to config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2227
diff changeset
886 self._subscribable_events = events.get_subscribable_events()
fe37834deb3d Move a list of event handlers and subscribable events to config.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2227
diff changeset
887 return getattr(self, "_subscribable_events")
2643
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
888
3223
6ca25943fd1a Fixed PageEditor tests; also fixed the subscribable_events property
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 3215
diff changeset
889 def setter(self, new_events):
6ca25943fd1a Fixed PageEditor tests; also fixed the subscribable_events property
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 3215
diff changeset
890 self._subscribable_events = new_events
2643
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
891
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
892 return property(getter, setter)
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
893 subscribable_events = make_subscribable_events_prop()
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
894
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
895 # lazily create a list of event handlers
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
896 def make_event_handlers_prop():
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
897 def getter(self):
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
898 if getattr(self, "_event_handlers", None) is None:
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
899 self._event_handlers = events.get_handlers(self)
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
900 return getattr(self, "_event_handlers")
3240
e8fcaf99434f config.multiconfig: PEP8 fixed
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3223
diff changeset
901
3223
6ca25943fd1a Fixed PageEditor tests; also fixed the subscribable_events property
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 3215
diff changeset
902 def setter(self, new_handlers):
6ca25943fd1a Fixed PageEditor tests; also fixed the subscribable_events property
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 3215
diff changeset
903 self._event_handlers = new_handlers
3240
e8fcaf99434f config.multiconfig: PEP8 fixed
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3223
diff changeset
904
3223
6ca25943fd1a Fixed PageEditor tests; also fixed the subscribable_events property
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 3215
diff changeset
905 return property(getter, setter)
2643
ec855cfb2561 Load event handler lazily.
Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
parents: 2595
diff changeset
906 event_handlers = make_event_handlers_prop()
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
907
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
908 def load_IWID(self):
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
909 """ Loads the InterWikiID of this instance. It is used to identify the instance
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
910 globally.
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
911 The IWID is available as cfg.iwid
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
912 The full IWID containing the interwiki name is available as cfg.iwid_full
1118
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
913 This method is called by the property.
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
914 """
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
915 try:
1080
f8ba3b0ca9f4 Use the meta dict instead of a distinct file for the IWID.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1053
diff changeset
916 iwid = self.meta_dict['IWID']
f8ba3b0ca9f4 Use the meta dict instead of a distinct file for the IWID.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1053
diff changeset
917 except KeyError:
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
918 iwid = util.random_string(16).encode("hex") + "-" + str(int(time.time()))
1080
f8ba3b0ca9f4 Use the meta dict instead of a distinct file for the IWID.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1053
diff changeset
919 self.meta_dict['IWID'] = iwid
f8ba3b0ca9f4 Use the meta dict instead of a distinct file for the IWID.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1053
diff changeset
920 self.meta_dict.sync()
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
921
1118
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
922 self._iwid = iwid
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
923 if self.interwikiname is not None:
1118
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
924 self._iwid_full = packLine([iwid, self.interwikiname])
1053
6632f9919a89 Implemented IWID system.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1011
diff changeset
925 else:
1118
156d160b1dd9 Load the IWID and the meta dict lazily.
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 1111
diff changeset
926 self._iwid_full = packLine([iwid])
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
927
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
928 def _config_check(self):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
929 """ Check namespace and warn about unknown names
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
930
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
931 Warn about names which are not used by DefaultConfig, except
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
932 modules, classes, _private or __magic__ names.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
933
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
934 This check is disabled by default, when enabled, it will show an
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
935 error message with unknown names.
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
936 """
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
937 unknown = ['"%s"' % name for name in dir(self)
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
938 if not name.startswith('_') and
1868
64507f46beb2 reduce usage of has_key()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1799
diff changeset
939 name not in DefaultConfig.__dict__ and
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
940 not isinstance(getattr(self, name), (type(sys), type(DefaultConfig)))]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
941 if unknown:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
942 msg = """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
943 Unknown configuration options: %s.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
944
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
945 For more information, visit HelpOnConfiguration. Please check your
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
946 configuration for typos before requesting support or reporting a bug.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
947 """ % ', '.join(unknown)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
948 raise error.ConfigurationError(msg)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
949
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
950 def _decode(self):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
951 """ Try to decode certain names, ignore unicode values
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
952
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
953 Try to decode str using utf-8. If the decode fail, raise FatalError.
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
954
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
955 Certain config variables should contain unicode values, and
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
956 should be defined with u'text' syntax. Python decode these if
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
957 the file have a 'coding' line.
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
958
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
959 This will allow utf-8 users to use simple strings using, without
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
960 using u'string'. Other users will have to use u'string' for
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
961 these names, because we don't know what is the charset of the
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
962 config files.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
963 """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
964 charset = 'utf-8'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
965 message = u'''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
966 "%(name)s" configuration variable is a string, but should be
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
967 unicode. Use %(name)s = u"value" syntax for unicode variables.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
968
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
969 Also check your "-*- coding -*-" line at the top of your configuration
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
970 file. It should match the actual charset of the configuration file.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
971 '''
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
972
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
973 decode_names = (
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
974 'sitename', 'logo_string', 'navi_bar', 'page_front_page',
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
975 'page_category_regex', 'page_dict_regex',
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
976 'page_group_regex', 'page_template_regex', 'page_license_page',
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
977 'page_local_spelling_words', 'acl_rights_default',
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
978 'acl_rights_before', 'acl_rights_after', 'mail_from'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
979 )
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
980
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
981 for name in decode_names:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
982 attr = getattr(self, name, None)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
983 if attr:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
984 # Try to decode strings
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
985 if isinstance(attr, str):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
986 try:
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
987 setattr(self, name, unicode(attr, charset))
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
988 except UnicodeError:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
989 raise error.ConfigurationError(message %
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
990 {'name': name})
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
991 # Look into lists and try to decode strings inside them
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
992 elif isinstance(attr, list):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
993 for i in xrange(len(attr)):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
994 item = attr[i]
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
995 if isinstance(item, str):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
996 try:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
997 attr[i] = unicode(item, charset)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
998 except UnicodeError:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
999 raise error.ConfigurationError(message %
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1000 {'name': name})
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1001
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1002 def _check_directories(self):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1003 """ Make sure directories are accessible
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1004
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1005 Both data and underlay should exists and allow read, write and
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1006 execute.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1007 """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1008 mode = os.F_OK | os.R_OK | os.W_OK | os.X_OK
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1009 for attr in ('data_dir', 'data_underlay_dir'):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1010 path = getattr(self, attr)
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
1011
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1012 # allow an empty underlay path or None
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1013 if attr == 'data_underlay_dir' and not path:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1014 continue
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1015
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1016 path_pages = os.path.join(path, "pages")
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1017 if not (os.path.isdir(path_pages) and os.access(path_pages, mode)):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1018 msg = '''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1019 %(attr)s "%(path)s" does not exists, or has incorrect ownership or
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1020 permissions.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1021
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1022 Make sure the directory and the subdirectory pages are owned by the web
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1023 server and are readable, writable and executable by the web server user
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1024 and group.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1025
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1026 It is recommended to use absolute paths and not relative paths. Check
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1027 also the spelling of the directory name.
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
1028 ''' % {'attr': attr, 'path': path, }
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1029 raise error.ConfigurationError(msg)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1030
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1031 def _loadPluginModule(self):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1032 """ import plugin module under configname.plugin
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1033
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1034 To be able to import plugin from arbitrary path, we have to load
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1035 the base package once using imp.load_module. Later, we can use
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1036 standard __import__ call to load plugins in this package.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1037
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1038 Since each wiki has unique plugins, we load the plugin package
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1039 under the wiki configuration module, named self.siteid.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1040 """
1791
6dd2e29acffe Eclipse PyDev Check: fixed lots of its errors and warnings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1787
diff changeset
1041 import imp
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1042
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1043 name = self.siteid + '.plugin'
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1044 try:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1045 # Lock other threads while we check and import
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1046 imp.acquire_lock()
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1047 try:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1048 # If the module is not loaded, try to load it
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1049 if not name in sys.modules:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1050 # Find module on disk and try to load - slow!
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1051 plugin_parent_dir = os.path.abspath(os.path.join(self.plugin_dir, '..'))
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1052 fp, path, info = imp.find_module('plugin', [plugin_parent_dir])
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1053 try:
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
1054 # Load the module and set in sys.modules
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1055 module = imp.load_module(name, fp, path, info)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1056 sys.modules[self.siteid].plugin = module
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1057 finally:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1058 # Make sure fp is closed properly
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1059 if fp:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1060 fp.close()
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1061 finally:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1062 imp.release_lock()
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1063 except ImportError, err:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1064 msg = '''
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1065 Could not import plugin package "%(path)s/plugin" because of ImportError:
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1066 %(err)s.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1067
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1068 Make sure your data directory path is correct, check permissions, and
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1069 that the data/plugin directory has an __init__.py file.
915
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
1070 ''' % {
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
1071 'path': self.data_dir,
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
1072 'err': str(err),
f3f38ecf4cf3 add hint to configuration error msg about potential name clash reason
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 877
diff changeset
1073 }
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1074 raise error.ConfigurationError(msg)
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1075
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1076 def _fillDicts(self):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1077 """ fill config dicts
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1078
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1079 Fills in missing dict keys of derived user config by copying
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1080 them from this base class.
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1081 """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1082 # user checkbox defaults
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1083 for key, value in DefaultConfig.user_checkbox_defaults.items():
1868
64507f46beb2 reduce usage of has_key()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1799
diff changeset
1084 if key not in self.user_checkbox_defaults:
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1085 self.user_checkbox_defaults[key] = value
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1086
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1087 def __getitem__(self, item):
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1088 """ Make it possible to access a config object like a dict """
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1089 return getattr(self, item)
931
141083b64fb1 whitespace and minor style changes only
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 928
diff changeset
1090
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2227
diff changeset
1091 # remove the gettext pseudo function
706
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1092 del _
fce105e8b3df Fixed line endings in multiconfig.py
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 705
diff changeset
1093