view MoinMoin/util/chartypes_create.py @ 4109:e88baf535b48

fix backup action configuration (broke on windows due to backslashes in e.g. cache_dir), try 2. cfg.backup_exclude is now just a function of filename, telling whether the file should be excluded. By default, no file is excluded.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 19 Sep 2008 21:41:40 +0200
parents 01f05e74aa9c
children
line wrap: on
line source
"""
    Build MoinMoin/util/chartypes.py with
    UCS-2 character types (upper/lower/digits/spaces).

    @copyright: 2004 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details
"""

uppercase = []
lowercase = []
digits = []
space = []
for code in range(1, 65535):
    c = unichr(code)
    str = "\\u%04x" % code
    if c.isupper():
        uppercase.append(str)
    elif c.islower():
        lowercase.append(str)
    elif c.isdigit():
        digits.append(str)
    elif c.isspace():
        space.append(str)

chars_upper = u''.join(uppercase)
chars_lower = u''.join(lowercase+digits)
chars_digits = u''.join(digits)
chars_spaces = u''.join(space)

print """
chars_upper = u"%(chars_upper)s"

chars_lower = u"%(chars_lower)s"

chars_digits = u"%(chars_digits)s"

chars_spaces = u"%(chars_spaces)s"


""" % globals()