src/reportlab/__init__.py
author robin
Wed, 11 Dec 2013 15:26:34 +0000
branchpy33
changeset 3940 39b5e5c82ea1
parent 3820 47edc5ad9dc6
child 3946 d7705185366c
permissions -rw-r--r--
reportlab/__init__.py: fix allowed version checks & remove cruft
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3617
ae5744e97c42 reportlab: copyright date changes
robin
parents: 3612
diff changeset
     1
#Copyright ReportLab Europe Ltd. 2000-2012
494
54257447cfe9 Changed to indirect copyright
rgbecker
parents: 478
diff changeset
     2
#see license.txt for license details
2332
2a7ab4405e18 Remove $Header:, fix CopyRight & history
rgbecker
parents: 2216
diff changeset
     3
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/__init__.py
2a7ab4405e18 Remove $Header:, fix CopyRight & history
rgbecker
parents: 2216
diff changeset
     4
__version__=''' $Id$ '''
681
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
     5
__doc__="""The Reportlab PDF generation library."""
3675
b40d6ba2ff81 bumped the version
Andy Robinson <andy@reportlab.com>
parents: 3617
diff changeset
     6
Version = "2.7"
2618
19c47ce76a0c changed version and added warning for old Python users
andy
parents: 2407
diff changeset
     7
19c47ce76a0c changed version and added warning for old Python users
andy
parents: 2407
diff changeset
     8
import sys
19c47ce76a0c changed version and added warning for old Python users
andy
parents: 2407
diff changeset
     9
3940
39b5e5c82ea1 reportlab/__init__.py: fix allowed version checks & remove cruft
robin
parents: 3820
diff changeset
    10
if sys.version_info[0:2]!=(2, 7) and sys.version_info<(3, 3):
39b5e5c82ea1 reportlab/__init__.py: fix allowed version checks & remove cruft
robin
parents: 3820
diff changeset
    11
    raise ImportError("""reportlab requires Python 2.7+ or 3.3+; 3.0-3.2 are not supported.""")
3820
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    12
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    13
#define these early in reportlab's life
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    14
isPy3 = sys.version_info[0]==3
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    15
if isPy3:
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    16
    def cmp(a,b):
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    17
        return -1 if a<b else (1 if a>b else 0)
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    18
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    19
    import builtins
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    20
    builtins.cmp = cmp
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    21
    del cmp, builtins
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    22
else:
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    23
    from future_builtins import ascii
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    24
    import __builtin__
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    25
    __builtin__.ascii = ascii
47edc5ad9dc6 move utils.py builtins defs to __init__.py
robin
parents: 3741
diff changeset
    26
    del ascii, __builtins__