Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd2cc68

Browse files
committed
fixed a bug in rcsetup, see bug 1845057
svn path=/trunk/matplotlib/; revision=4647
1 parent 8bf3220 commit dd2cc68

3 files changed

Lines changed: 15 additions & 19 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2007-12-06 fixed a bug in rcsetup, see bug 1845057 - DSD
2+
13
===============================================================
24
2007-11-27 Released 0.91.1 at revision 4517
35

lib/matplotlib/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,15 @@ def rc_params(fail_on_error=False):
615615
if ret['datapath'] is None:
616616
ret['datapath'] = get_data_path()
617617

618+
if not ret['text.latex.preamble'] == ['']:
619+
verbose.report("""
620+
*****************************************************************
621+
You have the following UNSUPPORTED LaTeX preamble customizations:
622+
%s
623+
Please do not ask for support with these customizations active.
624+
*****************************************************************
625+
"""% '\n'.join(ret['text.latex.preamble']), 'helpful')
626+
618627
verbose.report('loaded rc file %s'%fname)
619628

620629
return ret

lib/matplotlib/rcsetup.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def validate_color(s):
143143

144144
if len(s)==6 and s.isalnum(): # looks like hex
145145
return '#' + s
146-
146+
147147
if len(s)==7 and s.startswith('#') and s[1:].isalnum():
148148
return s
149149

@@ -165,21 +165,6 @@ def validate_stringlist(s):
165165
'landscape', 'portrait',
166166
])
167167

168-
def validate_latex_preamble(s):
169-
'return a list'
170-
preamble_list = validate_stringlist(s)
171-
if not preamble_list == ['']:
172-
verbose.report("""
173-
*****************************************************************
174-
You have the following UNSUPPORTED LaTeX preamble customizations:
175-
%s
176-
Please do not ask for support with these customizations active.
177-
*****************************************************************
178-
"""% '\n'.join(preamble_list), 'helpful')
179-
return preamble_list
180-
181-
182-
183168
def validate_aspect(s):
184169
if s in ('auto', 'equal'):
185170
return s
@@ -198,7 +183,7 @@ def validate_fontsize(s):
198183
return float(s)
199184
except ValueError:
200185
raise ValueError('not a valid font size')
201-
186+
202187
def validate_font_properties(s):
203188
parse_fontconfig_pattern(s)
204189
return s
@@ -353,7 +338,7 @@ def __call__(self, s):
353338
'text.color' : ['k', validate_color], # black
354339
'text.usetex' : [False, validate_bool],
355340
'text.latex.unicode' : [False, validate_bool],
356-
'text.latex.preamble' : [[''], validate_latex_preamble],
341+
'text.latex.preamble' : [[''], validate_stringlist],
357342
'text.dvipnghack' : [False, validate_bool],
358343
'text.fontstyle' : ['normal', str],
359344
'text.fontangle' : ['normal', str],
@@ -369,7 +354,7 @@ def __call__(self, s):
369354
'mathtext.sf' : ['sans\-serif', validate_font_properties],
370355
'mathtext.fontset' : ['cm', validate_fontset],
371356
'mathtext.fallback_to_cm' : [True, validate_bool],
372-
357+
373358
'image.aspect' : ['equal', validate_aspect], # equal, auto, a number
374359
'image.interpolation' : ['bilinear', str],
375360
'image.cmap' : ['jet', str], # one of gray, jet, etc

0 commit comments

Comments
 (0)