From: <ds...@us...> - 2007-08-22 18:43:30
|
Revision: 3728 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3728&view=rev Author: dsdale Date: 2007-08-22 11:43:13 -0700 (Wed, 22 Aug 2007) Log Message: ----------- add an update method to rcParamsWrapper Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/config/mplconfig.py Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-08-21 19:42:28 UTC (rev 3727) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-08-22 18:43:13 UTC (rev 3728) @@ -461,7 +461,18 @@ def has_key(self, val): return self.tconfig_map.has_key(val) + def update(self, arg, **kwargs): + try: + for key in arg: + self[key] = arg[key] + except AttributeError: + for key, val in arg: + self[key] = val + + for key in kwargs: + self[key] = kwargs[key] + old_config_file = cutils.get_config_file(tconfig=False) old_config_path = os.path.split(old_config_file)[0] config_file = os.path.join(old_config_path, 'matplotlib.conf') @@ -503,8 +514,9 @@ config_file) def rcdefaults(): + global mplConfig mplConfig = MPLConfig() - rcParams = RcParamsWrapper(mplConfig) + rcParams.update(rcParamsDefault) ############################################################################## # Auto-generate the mpl-data/matplotlib.conf This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |