]>
git.saurik.com Git - wxWidgets.git/blob - utils/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')
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 #----------------------------------------------------------------------------
84 # Revision 1.2 1999/02/25 07:09:51 RD
85 # wxPython version 2.0b5
87 # Revision 1.1 1998/12/15 20:44:37 RD
88 # Changed the import semantics from "from wxPython import *" to "from
89 # wxPython.wx import *" This is for people who are worried about
90 # namespace pollution, they can use "from wxPython import wx" and then
91 # prefix all the wxPython identifiers with "wx."
93 # Added wxTaskbarIcon for wxMSW.
95 # Made the events work for wxGrid.
99 # Added wxMiniFrame for wxGTK, (untested.)
101 # Changed many of the args and return values that were pointers to gdi
102 # objects to references to reflect changes in the wxWindows API.
104 # Other assorted fixes and additions.