configManager.write() rcParams = RcParamsWrapper(mplConfig) rcParamsDefault = RcParamsWrapper(mplConfigDefault) # convert old matplotlibrc to new matplotlib.conf if CONVERT: from rcparams import rcParams as old_rcParams for key, val in old_rcParams.iteritems(): rcParams[key] = val save_config() print '%s converted to %s'%(cutils.get_config_file(tconfig=False), config_file) def rcdefaults(): """ Restore the default rc params - the ones that were created at matplotlib load time """ for key in rcParamsDefault.keys(): rcParams[key] = rcParamsDefault[key] ############################################################################## # Auto-generate the mpl-data/matplotlib.conf ############################################################################## if __name__ == "__main__": mplConfig = MPLConfig() tconf2File(mplConfig, '../mpl-data/matplotlib.conf.template', force=True) print 'matplotlib.conf.template created in ../mpl-data'
rcParams = RcParamsWrapper(mplConfig) rcParamsDefault = RcParamsWrapper(mplConfigDefault) # convert old matplotlibrc to new matplotlib.conf if CONVERT: from rcparams import rcParams as old_rcParams for key, val in old_rcParams.iteritems(): rcParams[key] = val save_config() print '%s converted to %s' % (cutils.get_config_file(tconfig=False), config_file) def rcdefaults(): """ Restore the default rc params - the ones that were created at matplotlib load time """ for key in rcParamsDefault.keys(): rcParams[key] = rcParamsDefault[key] ############################################################################## # Auto-generate the mpl-data/matplotlib.conf ############################################################################## if __name__ == "__main__": mplConfig = MPLConfig() tconf2File(mplConfig, '../mpl-data/matplotlib.conf.template', force=True) print 'matplotlib.conf.template created in ../mpl-data'
from tconfig import TConfigManager,tconf2File from simpleconf import SimpleConfig # Make and print to screen the default config conf = SimpleConfig() print repr(conf) # We can save this to disk: tconf2File(conf,'simple_default.conf',force=True) # <demo> stop # The GUI is auto-generated conf.edit_traits() # <demo> stop # A TConfigManager handles the coupling of a TConfig object to a ConfigObj # file, but the file can even start empty: fname = 'simple2.conf' !rm $fname conf2 = TConfigManager(SimpleConfig,fname) # This object starts 'empty', meaning it has no changes over the defaults print conf2 # <demo> stop