~ubuntu-branches/ubuntu/intrepid/moin/intrepid-updates

« back to all changes in this revision

Viewing changes to MoinMoin/util/chartypes_create.py

  • Committer: Bazaar Package Importer
  • Author(s): Sivan Greenberg
  • Date: 2006-07-09 19:28:02 UTC
  • Revision ID: james.westby@ubuntu.com-20060709192802-oaeuvt4v3e9300uj
Tags: 1.5.3-1ubuntu1
* Merge new debian version.
* Reapply Ubuntu changes:
    + debian/rules:
      - Comment out usage of control.ubuntu.in (doesn't fit!).
    + debian/control.in:
      - Dropped python2.3 binary package.
    + debian/control:
      - Dropped python2.3 binary, again.
      - Dropped python2.3-dev from Build-Depends-Indep.
    + debian/patches/001-attachment-xss-fix.patch:
      - Dropped this patch. It's now in upstream's distribution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
    Build MoinMoin/util/chartypes.py with
 
3
    UCS-2 character types (upper/lower/digits/spaces).
 
4
    
 
5
    @copyright: 2004 Thomas Waldmann
 
6
    @license: GNU GPL, see COPYING for details
 
7
"""
 
8
 
 
9
uppercase = []
 
10
lowercase = []
 
11
digits = []
 
12
space = []
 
13
for code in range(1,65535):
 
14
    c = unichr(code)
 
15
    str = "\\u%04x" % code
 
16
    if c.isupper():
 
17
        uppercase.append(str)
 
18
    elif c.islower():
 
19
        lowercase.append(str)
 
20
    elif c.isdigit():
 
21
        digits.append(str)
 
22
    elif c.isspace():
 
23
        space.append(str)
 
24
 
 
25
chars_upper = u''.join(uppercase)
 
26
chars_lower = u''.join(lowercase+digits)
 
27
chars_digits = u''.join(digits)
 
28
chars_spaces = u''.join(space)
 
29
 
 
30
print """
 
31
_chartypes = {
 
32
    'chars_upper': u"%(chars_upper)s",
 
33
    'chars_lower': u"%(chars_lower)s",
 
34
    'chars_digits': u"%(chars_digits)s",
 
35
    'chars_spaces': u"%(chars_spaces)s",
 
36
}
 
37
 
 
38
""" % globals()
 
39