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

Skip to content

Commit 1a135b7

Browse files
committed
Ability to use new, traited configuration system in mpl
svn path=/trunk/matplotlib/; revision=3632
1 parent 9624d8b commit 1a135b7

8 files changed

Lines changed: 225 additions & 199 deletions

File tree

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2007-07-30 Reorganized configuration code to work with traited config
2+
objects. The new config system is located in the
3+
matplotlib.config package, but it is disabled by default.
4+
To enable it, set NEWCONFIG=True in matplotlib.__init__.py.
5+
The new configuration system will still use the old
6+
matplotlibrc files by default. To switch to the experimental,
7+
traited configuration, set USE_TRAITED_CONFIG=True in
8+
config.__init__.py.
9+
110
2007-07-29 Changed default pcolor shading to flat; added aliases
211
to make collection kwargs agree with setter names, so
312
updating works; related minor cleanups.

lib/matplotlib/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"""
5656
from __future__ import generators
5757

58+
NEWCONFIG = False
5859

5960
__version__ = '0.90.1'
6061
__revision__ = '$Revision$'
@@ -706,6 +707,13 @@ def rcdefaults():
706707
"""
707708
rcParams.update(rcParamsDefault)
708709

710+
if NEWCONFIG:
711+
print "importing from reorganized config system!"
712+
from config import rcParams, rcdefaults
713+
try:
714+
from config import mplConfig, save_config
715+
except:
716+
pass
709717

710718
def use(arg):
711719
"""

lib/matplotlib/config/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# Please keep this file empty
1+
# Please keep this file empty
2+
3+
USE_TRAITED_CONFIG = False
4+
5+
from rcparams import rc
6+
from cutils import get_config_file
7+
8+
if USE_TRAITED_CONFIG:
9+
print 'Using new config system!'
10+
from mplconfig import rcParams, mplConfig, save_config, rcdefaults
11+
else:
12+
from rcparams import rcParams, rcdefaults

lib/matplotlib/config/api.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/matplotlib/config/cutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,4 @@ def get_config_file(tconfig=False):
179179
fname = os.path.join(path, filename)
180180
if not os.path.exists(fname):
181181
warnings.warn('Could not find %s; using defaults'%filename)
182-
return fname
182+
return fname

0 commit comments

Comments
 (0)