src/reportlab/__init__.py
author Andy Robinson <andy@reportlab.com>
Thu, 30 May 2013 11:08:55 +0100
changeset 3695 1b0c70ee944f
parent 3675 b40d6ba2ff81
child 3820 47edc5ad9dc6
permissions -rw-r--r--
Satisfying Pillow's Python 3 deprecation warnings
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
3695
1b0c70ee944f Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents: 3675
diff changeset
    10
if sys.version_info[0:2] < (2, 7):
1b0c70ee944f Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents: 3675
diff changeset
    11
    warning = """The trunk of reportlab currently requires Python 2.7 or higher.
1b0c70ee944f Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents: 3675
diff changeset
    12
1b0c70ee944f Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents: 3675
diff changeset
    13
    This is being done to let us move forwards with 2.7/3.x compatibility
1b0c70ee944f Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents: 3675
diff changeset
    14
    with the minimum of baggage.
1b0c70ee944f Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents: 3675
diff changeset
    15
    
1b0c70ee944f Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents: 3675
diff changeset
    16
    ReportLab 2.7 was the last packaged version to suppo0rt Python 2.5 and 2.6.
3327
512eb20b0c3d more 2to3ing
andy
parents: 3316
diff changeset
    17
512eb20b0c3d more 2to3ing
andy
parents: 3316
diff changeset
    18
    Python 2.3 users may still use ReportLab 2.4 or any other bugfixes
3612
1f92ba58b133 updated version
andy
parents: 3454
diff changeset
    19
    derived from it, and Python 2.4 users may use ReportLab 2.5.  
1f92ba58b133 updated version
andy
parents: 3454
diff changeset
    20
    Python 2.2 and below need to use released versions beginning with 
1f92ba58b133 updated version
andy
parents: 3454
diff changeset
    21
    1.x (e.g. 1.21), or snapshots or checkouts from our 'version1' branch.
1f92ba58b133 updated version
andy
parents: 3454
diff changeset
    22
    
1f92ba58b133 updated version
andy
parents: 3454
diff changeset
    23
    Our current plan is to remove Python 2.5 compatibility on our next release,
1f92ba58b133 updated version
andy
parents: 3454
diff changeset
    24
    allowing us to use the 2to3 tool and work on Python 3.0 compatibility.
1f92ba58b133 updated version
andy
parents: 3454
diff changeset
    25
    If you have a choice, Python 2.7.x is best long term version to use.
2618
19c47ce76a0c changed version and added warning for old Python users
andy
parents: 2407
diff changeset
    26
    """
3612
1f92ba58b133 updated version
andy
parents: 3454
diff changeset
    27
    raise ImportError("reportlab needs Python 2.5 or higher", warning)
681
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    28
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    29
def getStory(context):
3327
512eb20b0c3d more 2to3ing
andy
parents: 3316
diff changeset
    30
    "This is a helper for our old autogenerated documentation system"
681
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    31
    if context.target == 'UserGuide':
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    32
        # parse some local file
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    33
        import os
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    34
        myDir = os.path.split(__file__)[0]
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    35
        import yaml
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    36
        return yaml.parseFile(myDir + os.sep + 'mydocs.yaml')
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    37
    else:
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    38
        # this signals that it should revert to default processing
934a4f24ea5d Added explicit font and encoding support
andy_robinson
parents: 625
diff changeset
    39
        return None
2216
aadcd9dc9480 Font reregistration cleanup
andy_robinson
parents: 2203
diff changeset
    40
aadcd9dc9480 Font reregistration cleanup
andy_robinson
parents: 2203
diff changeset
    41
aadcd9dc9480 Font reregistration cleanup
andy_robinson
parents: 2203
diff changeset
    42
def getMonitor():
aadcd9dc9480 Font reregistration cleanup
andy_robinson
parents: 2203
diff changeset
    43
    import reportlab.monitor
aadcd9dc9480 Font reregistration cleanup
andy_robinson
parents: 2203
diff changeset
    44
    mon = reportlab.monitor.ReportLabToolkitMonitor()
2407
71caad345e58 reportlab: release 1.20
rgbecker
parents: 2332
diff changeset
    45
    return mon