root/ipython/branches/saw/sandbox/tconfig/mpltest.py

Revision 2549, 1.2 kB (checked in by fperez, 3 years ago)

API cleanup and name changes.

Line 
1 # import/reload base modules for interactive testing/development
2 import os
3
4 import tctst; reload(tctst)
5 from tctst import *
6
7 import mplconfig; reload(mplconfig)
8 from mplconfig import MPLConfig
9
10
11 mconf = 'mplrc.conf'
12 mplconf = TConfigManager(MPLConfig, mconf, filePriority=True)
13 mplconf.tconf.backend.use = 'Qt4Agg'
14 mplconf.write()
15
16 # Check that invalid assignments are not allowed
17 if 0:
18     mplrc = mplconf.tconf
19     mplrc.nonsense = 1
20     print mplrc
21
22
23 # Make and print to screen the default config
24 mpc = MPLConfig()
25 print repr(mpc)
26
27 # write it out to disk
28 tconf2File(mpc,'mplrc_default.conf',force=True)
29
30 # Create a copy of a hierarchical file, make a simple change, allow interactive
31 # editing and then write to disk.
32 os.system('cp mplrc2.conf mplrc2_copy.conf')
33
34 mconf2 = 'mplrc2_copy.conf'
35 mplconf2 = TConfigManager(MPLConfig,mconf2)
36
37 print '-'*80
38 print 'You can modify the object mplconf2.tconf interactively either'
39 print 'at the command line, or if you started ipython with -wthread support,'
40 print 'by typing:'
41 print 'mplconf2.tconf.edit_traits()'
42 print 'When finshed, you can save the object to disk via'
43 print 'mplconf2.write()'
44 print 'The file it writes is:',mconf2
45
46 #mplconf2.tconf.edit_traits()
47
Note: See TracBrowser for help on using the browser.