author | robin |
Thu, 21 Nov 2013 17:32:50 +0000 | |
branch | py33 |
changeset 3820 | 47edc5ad9dc6 |
parent 3741 | 0cadc486be4a |
child 3940 | 39b5e5c82ea1 |
permissions | -rw-r--r-- |
3617 | 1 |
#Copyright ReportLab Europe Ltd. 2000-2012 |
494 | 2 |
#see license.txt for license details |
2332 | 3 |
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/__init__.py |
4 |
__version__=''' $Id$ ''' |
|
681 | 5 |
__doc__="""The Reportlab PDF generation library.""" |
3675 | 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 |
|
3741
0cadc486be4a
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): |
0cadc486be4a
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. |
0cadc486be4a
Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents:
3675
diff
changeset
|
12 |
|
0cadc486be4a
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 |
0cadc486be4a
Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents:
3675
diff
changeset
|
14 |
with the minimum of baggage. |
0cadc486be4a
Satisfying Pillow's Python 3 deprecation warnings
Andy Robinson <andy@reportlab.com>
parents:
3675
diff
changeset
|
15 |
|
0cadc486be4a
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 | 17 |
|
18 |
Python 2.3 users may still use ReportLab 2.4 or any other bugfixes |
|
3612 | 19 |
derived from it, and Python 2.4 users may use ReportLab 2.5. |
20 |
Python 2.2 and below need to use released versions beginning with |
|
21 |
1.x (e.g. 1.21), or snapshots or checkouts from our 'version1' branch. |
|
22 |
||
23 |
Our current plan is to remove Python 2.5 compatibility on our next release, |
|
24 |
allowing us to use the 2to3 tool and work on Python 3.0 compatibility. |
|
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 | 27 |
raise ImportError("reportlab needs Python 2.5 or higher", warning) |
681 | 28 |
|
29 |
def getStory(context): |
|
3327 | 30 |
"This is a helper for our old autogenerated documentation system" |
681 | 31 |
if context.target == 'UserGuide': |
32 |
# parse some local file |
|
33 |
import os |
|
34 |
myDir = os.path.split(__file__)[0] |
|
35 |
import yaml |
|
36 |
return yaml.parseFile(myDir + os.sep + 'mydocs.yaml') |
|
37 |
else: |
|
38 |
# this signals that it should revert to default processing |
|
39 |
return None |
|
2216 | 40 |
|
41 |
||
42 |
def getMonitor(): |
|
43 |
import reportlab.monitor |
|
44 |
mon = reportlab.monitor.ReportLabToolkitMonitor() |
|
2407 | 45 |
return mon |
3820 | 46 |
|
47 |
#define these early in reportlab's life |
|
48 |
isPy3 = sys.version_info[0]==3 |
|
49 |
if isPy3: |
|
50 |
def cmp(a,b): |
|
51 |
return -1 if a<b else (1 if a>b else 0) |
|
52 |
||
53 |
import builtins |
|
54 |
builtins.cmp = cmp |
|
55 |
del cmp, builtins |
|
56 |
else: |
|
57 |
from future_builtins import ascii |
|
58 |
import __builtin__ |
|
59 |
__builtin__.ascii = ascii |
|
60 |
del ascii, __builtins__ |