File: _compact.py

package info (click to toggle)
ptable 0.9.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 332 kB
  • sloc: python: 1,651; makefile: 27; sh: 3
file content (33 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import sys


py3k = sys.version_info[0] >= 3

if py3k:
    str_types = (str, )
    unicode_ = str
    basestring_ = str
    itermap = map
    iterzip = zip
    uni_chr = chr
    from html.parser import HTMLParser
    import io as StringIO
else:
    unicode_ = unicode
    basestring_ = basestring
    str_types = (unicode, str)
    import itertools
    itermap = itertools.imap
    iterzip = itertools.izip
    uni_chr = unichr
    from HTMLParser import HTMLParser
    import StringIO

HTMLParser, StringIO


if py3k and sys.version_info[1] >= 2:
    from html import escape
else:
    from cgi import escape
escape