1
#Copyright ReportLab Europe Ltd. 2000-2004
2
#see license.txt for license details
3
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/rl_config.py
4
__version__=''' $Id$ '''
6
allowTableBoundsErrors = 1 # set to 0 to die on too large elements in tables in debug (recommend 1 for production use)
8
defaultEncoding = 'WinAnsiEncoding' # 'WinAnsi' or 'MacRoman'
9
pageCompression = 1 # default page compression mode
10
defaultPageSize = 'A4' #default page size
11
defaultImageCaching = 0 #set to zero to remove those annoying cached images
13
warnOnMissingFontGlyphs = 0 #if 1, warns of each missing glyph
15
showBoundary = 0 # turns on and off boundary behaviour in Drawing
16
emptyTableAction= 'error' # one of 'error', 'indicate', 'ignore'
17
invariant= 0 #produces repeatable,identical PDFs with same timestamp info (for regression testing)
18
eps_preview_transparent= None #set to white etc
19
overlapAttachedSpace= 1 #if set non false then adajacent flowable space after
20
#and space before are merged (max space is used).
21
_FUZZ= 1e-6 #fuzz for layout arithmetic
23
# places to look for T1Font information
25
'c:/Program Files/Adobe/Acrobat 6.0/Resource/Font', #Win32, Acrobat 6
26
'c:/Program Files/Adobe/Acrobat 5.0/Resource/Font', #Win32, Acrobat 5
27
'c:/Program Files/Adobe/Acrobat 4.0/Resource/Font', #Win32, Acrobat 4
28
'%(disk)s/Applications/Python %(sys_version)s/reportlab/fonts', #Mac?
29
'/usr/lib/Acrobat5/Resource/Font', #Linux, Acrobat 5?
30
'/usr/lib/Acrobat4/Resource/Font', #Linux, Acrobat 4
31
'/usr/local/Acrobat6/Resource/Font', #Linux, Acrobat 5?
32
'/usr/local/Acrobat5/Resource/Font', #Linux, Acrobat 5?
33
'/usr/local/Acrobat4/Resource/Font', #Linux, Acrobat 4
34
'%(REPORTLAB_DIR)s/fonts', #special
35
'%(REPORTLAB_DIR)s/../fonts', #special
36
'%(REPORTLAB_DIR)s/../../fonts', #special
37
'%(HOME)s/fonts', #special
40
# places to look for TT Font information
44
'/usr/lib/X11/fonts/TrueType/',
45
'%(REPORTLAB_DIR)s/fonts', #special
46
'%(REPORTLAB_DIR)s/../fonts', #special
47
'%(REPORTLAB_DIR)s/../../fonts',#special
48
'%(HOME)s/fonts', #special
51
# places to look for CMap files - should ideally merge with above
52
CMapSearchPath = ('/usr/lib/Acrobat6/Resource/CMap',
53
'/usr/lib/Acrobat5/Resource/CMap',
54
'/usr/lib/Acrobat4/Resource/CMap',
55
'/usr/local/Acrobat6/Resource/CMap',
56
'/usr/local/Acrobat5/Resource/CMap',
57
'/usr/local/Acrobat4/Resource/CMap',
58
'C:\\Program Files\\Adobe\\Acrobat\\Resource\\CMap',
59
'C:\\Program Files\\Adobe\\Acrobat 6.0\\Resource\\CMap',
60
'C:\\Program Files\\Adobe\\Acrobat 5.0\\Resource\\CMap',
61
'C:\\Program Files\\Adobe\\Acrobat 4.0\\Resource\\CMap'
62
'%(REPORTLAB_DIR)s/fonts/CMap', #special
63
'%(REPORTLAB_DIR)s/../fonts/CMap', #special
64
'%(REPORTLAB_DIR)s/../../fonts/CMap', #special
65
'%(HOME)s/fonts/CMap', #special
68
#### Normally don't need to edit below here ####
70
from local_rl_config import *
77
def _setOpt(name, value, conv=None):
78
'''set a module level value from environ/default'''
79
from os import environ
81
if environ.has_key(ename):
82
value = environ[ename]
83
if conv: value = conv(value)
84
globals()[name] = value
87
'''This function allows easy resetting to the global defaults
88
If the environment contains 'RL_xxx' then we use the value
89
else we use the given default'''
90
V = ('T1SearchPath','CMapSearchPath', 'TTFSearchPath',
91
'shapeChecking', 'defaultEncoding',
92
'pageCompression', 'defaultPageSize', 'defaultImageCaching',
93
'ZLIB_WARNINGS', 'warnOnMissingFontGlyphs', 'verbose', 'emptyTableAction',
94
'invariant','eps_preview_transparent',
96
import os, sys, string
97
global sys_version, _unset_
98
sys_version = string.split(sys.version)[0] #strip off the other garbage
99
from reportlab.lib import pagesizes
100
from reportlab.lib.utils import rl_isdir
103
_unset_ = getattr(sys,'_rl_config__unset_',None)
106
sys._rl_config__unset_ = _unset_ = _unset_()
108
_SAVED[k] = globals()[k]
110
#places to search for Type 1 Font files
112
D = {'REPORTLAB_DIR': os.path.abspath(os.path.dirname(reportlab.__file__)),
113
'HOME': os.environ.get('HOME',os.getcwd()),
114
'disk': string.split(os.getcwd(), ':')[0],
115
'sys_version': sys_version,
118
for name in ('T1SearchPath','TTFSearchPath','CMapSearchPath'):
120
for p in _SAVED[name]:
121
d = string.replace(p % D,'/',os.sep)
122
if rl_isdir(d): P.append(d)
127
if type(v)==type(1): conv = int
128
elif k=='defaultPageSize': conv = lambda v,M=pagesizes: getattr(M,v)