]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/tests/test6.py
2 #----------------------------------------------------------------------------
4 # Purpose: Testing wxConfig
10 # Copyright: (c) 1998 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------------
15 from wxPython
.utils
import wxConfig
18 #----------------------------------------------------------------------------
22 cfg
= wxConfig('test6', 'TCS', ".testconfig")
29 cfg
.SetPath('one/two/three')
32 cfg
.Write('aaa', 'The quick brown fox jummped over the lazy dog.')
33 cfg
.Write('bbb', 'This is a test of the emergency broadcast system')
35 aList
= ['one', 'two', 'buckle', 'my', 'shoe', 1966]
36 cfg
.Write('ccc', str(aList
))
38 cfg
.Write('zzz/yyy', 'foobar')
39 cfg
.Write('zzz/xxx', 'spam and eggs')
50 print 'Specify command: add, enum, or del.'
54 def traverse(cfg
, path
):
56 cont
, val
, idx
= cfg
.GetFirstEntry()
58 print "%s/%s = %s" % (path
, val
, cfg
.Read(val
))
59 cont
, val
, idx
= cfg
.GetNextEntry(idx
)
61 cont
, val
, idx
= cfg
.GetFirstGroup()
66 newpath
= path
+'/'+val
69 traverse(cfg
, newpath
)
71 cont
, val
, idx
= cfg
.GetNextGroup(idx
)
75 if __name__
== '__main__':
81 #----------------------------------------------------------------------------