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

Skip to content

Commit 81ae6cc

Browse files
committed
minor changes to traited configs
svn path=/trunk/matplotlib/; revision=3634
1 parent 17a074e commit 81ae6cc

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ def rcdefaults():
708708
rcParams.update(rcParamsDefault)
709709

710710
if NEWCONFIG:
711-
print "importing from reorganized config system!"
711+
#print "importing from reorganized config system!"
712712
from config import rcParams, rcdefaults
713713
try:
714714
from config import mplConfig, save_config

lib/matplotlib/config/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Please keep this file empty
22

3-
USE_TRAITED_CONFIG = False
3+
USE_TRAITED_CONFIG = True
44

55
from rcparams import rc
66
from cutils import get_config_file
77

88
if USE_TRAITED_CONFIG:
9-
print 'Using new config system!'
9+
#print 'Using new config system!'
1010
from mplconfig import rcParams, mplConfig, save_config, rcdefaults
1111
else:
1212
from rcparams import rcParams, rcdefaults

lib/matplotlib/config/mplconfig.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class ps(TConfig):
8888
fonttype = T.Trait(3, 42)
8989

9090
class distiller(TConfig):
91-
use = T.Trait(None, None, 'ghostscript', 'xpdf')
91+
use = T.Trait(None, None, 'ghostscript', 'xpdf', False)
9292
resolution = T.Float(6000)
9393

9494
class pdf(TConfig):
@@ -267,7 +267,7 @@ class savefig(TConfig):
267267
dpi = T.Float(100)
268268
facecolor = T.Trait('white', mplT.ColorHandler())
269269
edgecolor = T.Trait('white', mplT.ColorHandler())
270-
orientation = T.Trait('portrait', 'portrait', 'landscape')
270+
orientation = T.Trait('portrait', 'portrait', 'landscape')
271271

272272
class verbose(TConfig):
273273
level = T.Trait('silent', 'silent', 'helpful', 'debug', 'debug-annoying')
@@ -457,13 +457,19 @@ def has_key(self, val):
457457
return self.tconfig_map.has_key(val)
458458

459459

460-
config_file = cutils.get_config_file(tconfig=True)
461460
old_config_file = cutils.get_config_file(tconfig=False)
461+
old_config_path = os.path.split(old_config_file)[0]
462+
config_file = os.path.join(old_config_path, 'matplotlib.conf')
463+
462464
if os.path.exists(old_config_file) and not os.path.exists(config_file):
465+
print 'convert!'
463466
CONVERT = True
464-
else: CONVERT = False
467+
else:
468+
config_file = cutils.get_config_file(tconfig=True)
469+
CONVERT = False
470+
465471
configManager = TConfigManager(MPLConfig,
466-
cutils.get_config_file(tconfig=True),
472+
config_file,
467473
filePriority=True)
468474
mplConfig = configManager.tconf
469475
mplConfigDefault = MPLConfig()

lib/matplotlib/config/mpltraits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BackendHandler(T.TraitHandler):
3232
'ps': 'PS',
3333
'pdf': 'PDF',
3434
'svg': 'SVG',
35-
'template': 'Templates' }
35+
'template': 'Template' }
3636

3737
def validate(self, object, name, value):
3838
try:
@@ -143,4 +143,4 @@ def validate(self, object, name, value):
143143
'gist_yarg', 'gist_yarg_r', 'gray', 'gray_r', 'hot', 'hot_r',
144144
'hsv', 'hsv_r', 'jet', 'jet_r', 'pink', 'pink_r',
145145
'prism', 'prism_r', 'spectral', 'spectral_r', 'spring',
146-
'spring_r', 'summer', 'summer_r', 'winter', 'winter_r']
146+
'spring_r', 'summer', 'summer_r', 'winter', 'winter_r']

lib/matplotlib/mpl-data/matplotlibrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ numerix : numpy # numpy, Numeric or numarray
243243
#savefig.dpi : 100 # figure dots per inch
244244
#savefig.facecolor : white # figure facecolor when saving
245245
#savefig.edgecolor : white # figure edgecolor when saving
246+
#savefig.orientation : portrait # portrait or landscape
246247

247248
#cairo.format : png # png, ps, pdf, svg
248249

0 commit comments

Comments
 (0)