Back to index

moin  1.9.0~rc2
__init__.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - site-wide configuration defaults (NOT per single wiki!)
00004 
00005     @copyright: 2005-2006 MoinMoin:ThomasWaldmann
00006     @license: GNU GPL, see COPYING for details.
00007 """
00008 import re
00009 from MoinMoin import version
00010 
00011 # unicode: set the char types (upper, lower, digits, spaces)
00012 from MoinMoin.util.chartypes import *
00013 
00014 # List of image types browser do support regulary
00015 browser_supported_images = ('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', )
00016 
00017 # Parser to use mimetype text
00018 parser_text_mimetype = ('plain', 'csv', 'rst', 'docbook', 'latex', 'tex', 'html', 'css',
00019                        'xml', 'python', 'perl', 'php', 'ruby', 'javascript',
00020                        'cplusplus', 'java', 'pascal', 'diff', 'gettext', 'xslt', 'creole', )
00021 
00022 # When creating files, we use e.g. 0666 & config.umask for the mode:
00023 umask = 0770
00024 
00025 # Default value for the static stuff URL prefix (css, img, js).
00026 # Caution:
00027 # * do NOT use this directly, it is only the DEFAULT value to be used by
00028 #   server Config classes and by multiconfig.py for request.cfg.
00029 # * must NOT end with '/'!
00030 # * some servers expect '/' at beginning and only 1 level deep.
00031 url_prefix_static = '/moin_static' + version.release_short
00032 
00033 # Threads flag - if you write a moin server that use threads, import
00034 # config in the server and set this flag to True.
00035 use_threads = False
00036 
00037 # Charset - we support only 'utf-8'. While older encodings might work,
00038 # we don't have the resources to test them, and there is no real
00039 # benefit for the user. IMPORTANT: use only lowercase 'utf-8'!
00040 charset = 'utf-8'
00041 
00042 # Regex to find lower->upper transitions (word boundaries in WikiNames), used by split_title
00043 split_regex = re.compile('([%s])([%s])' % (chars_lower, chars_upper), re.UNICODE)
00044 
00045 # Invalid characters - invisible characters that should not be in page
00046 # names. Prevent user confusion and wiki abuse, e.g u'\u202aFrontPage'.
00047 page_invalid_chars_regex = re.compile(
00048     ur"""
00049     \u0000 | # NULL
00050 
00051     # Bidi control characters
00052     \u202A | # LRE
00053     \u202B | # RLE
00054     \u202C | # PDF
00055     \u202D | # LRM
00056     \u202E   # RLM
00057     """,
00058     re.UNICODE | re.VERBOSE
00059     )
00060 
00061 # used for wikiutil.clean_input
00062 clean_input_translation_map = {
00063     # these chars will be replaced by blanks
00064     ord(u'\t'): u' ',
00065     ord(u'\r'): u' ',
00066     ord(u'\n'): u' ',
00067 }
00068 for c in u'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f' \
00069           '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f':
00070     # these chars will be removed
00071     clean_input_translation_map[ord(c)] = None
00072 del c
00073 
00074 # Other stuff
00075 url_schemas = ['http', 'https', 'ftp', 'file',
00076                'mailto', 'nntp', 'news',
00077                'ssh', 'telnet', 'irc', 'ircs', 'xmpp', 'mumble',
00078                'webcal', 'ed2k', 'apt', 'rootz',
00079                'gopher',
00080                'notes',
00081               ]
00082 
00083 smileys = (r"X-( :D <:( :o :( :) B) :)) ;) /!\ <!> (!) :-? :\ >:> |) " +
00084            r":-( :-) B-) :-)) ;-) |-) (./) {OK} {X} {i} {1} {2} {3} {*} {o}").split()