annotate MoinMoin/config/__init__.py @ 3004:0ae378dc1edf

updated ldap support from 1.5 branch: tls support, configuration defaults, comments/docs (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Jan 2008 18:48:58 +0100
parents 4197965b0820
children 1d3e65884337
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3 MoinMoin - site-wide configuration defaults (NOT per single wiki!)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
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: 1795
diff changeset
5 @copyright: 2005-2006 MoinMoin:ThomasWaldmann
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
6 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
7 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8 import re
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: 1011
diff changeset
9 from MoinMoin import version
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10
1949
cfdb0ffc2910 move logging_fix import to MoinMoin.config, fix encoding/docstring
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1922
diff changeset
11 # this fix is done here because everyone imports config rather early
cfdb0ffc2910 move logging_fix import to MoinMoin.config, fix encoding/docstring
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1922
diff changeset
12 from MoinMoin.support import logging_fix
cfdb0ffc2910 move logging_fix import to MoinMoin.config, fix encoding/docstring
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1922
diff changeset
13
1795
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
14 # unicode: set the char types (upper, lower, digits, spaces)
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
15 from MoinMoin.util.chartypes import *
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16
1011
58f5af49cd03 move config and multiconfig to config/ package, see HINT in CHANGES
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 734
diff changeset
17 # When creating files, we use e.g. 0666 & config.umask for the mode:
58f5af49cd03 move config and multiconfig to config/ package, see HINT in CHANGES
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 734
diff changeset
18 umask = 0770
58f5af49cd03 move config and multiconfig to config/ package, see HINT in CHANGES
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 734
diff changeset
19
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: 1011
diff changeset
20 # Default value for the static stuff URL prefix (css, img, js).
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
21 # Caution:
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
22 # * do NOT use this directly, it is only the DEFAULT value to be used by
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
23 # server Config classes and by multiconfig.py for request.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: 1011
diff changeset
24 # * must NOT end with '/'!
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
25 # * some servers expect '/' at beginning and only 1 level deep.
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
26 url_prefix_static = '/moin_static' + version.release_short
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
27
1795
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
28 # Threads flag - if you write a moin server that use threads, import
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
29 # config in the server and set this flag to True.
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
30 use_threads = False
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
31
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
32 # Charset - we support only 'utf-8'. While older encodings might work,
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
33 # we don't have the resources to test them, and there is no real
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
34 # benefit for the user. IMPORTANT: use only lowercase 'utf-8'!
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
35 charset = 'utf-8'
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
36
2250
07fdbda38be2 move split_regex to config (so it is compiled only once)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2187
diff changeset
37 # Regex to find lower->upper transitions (word boundaries in WikiNames), used by split_title
2251
4197965b0820 fix: use re.UNICODE for split_regex
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2250
diff changeset
38 split_regex = re.compile('([%s])([%s])' % (chars_lower, chars_upper), re.UNICODE)
2250
07fdbda38be2 move split_regex to config (so it is compiled only once)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2187
diff changeset
39
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
40 # Invalid characters - invisible characters that should not be in page
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
41 # names. Prevent user confusion and wiki abuse, e.g u'\u202aFrontPage'.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
42 page_invalid_chars_regex = re.compile(
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
43 ur"""
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
44 \u0000 | # NULL
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
45
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
46 # Bidi control characters
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
47 \u202A | # LRE
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
48 \u202B | # RLE
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
49 \u202C | # PDF
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
50 \u202D | # LRM
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
51 \u202E # RLM
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
52 """,
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
53 re.UNICODE | re.VERBOSE
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
54 )
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
55
1922
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
56 # used for wikiutil.clean_input
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
57 clean_input_translation_map = {
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
58 # these chars will be replaced by blanks
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
59 ord(u'\t'): u' ',
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
60 ord(u'\r'): u' ',
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
61 ord(u'\n'): u' ',
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
62 }
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
63 for c in u'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f' \
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
64 '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f':
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
65 # these chars will be removed
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
66 clean_input_translation_map[ord(c)] = None
2187
15c11fe8f6b2 config/multiconfig: minor cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1949
diff changeset
67 del c
1922
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
68
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
69 # Other stuff
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
70 url_schemas = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
71
734
bf2435e61f97 moved smileys from MoinMoin.config to theme, fixed smiley text_python caching bug
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 729
diff changeset
72 smileys = (r"X-( :D <:( :o :( :) B) :)) ;) /!\ <!> (!) :-? :\ >:> |) " +
bf2435e61f97 moved smileys from MoinMoin.config to theme, fixed smiley text_python caching bug
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 729
diff changeset
73 r":-( :-) B-) :-)) ;-) |-) (./) {OK} {X} {i} {1} {2} {3} {*} {o}").split()