blob: 97c0c74df47e7e083ee543d557c63ab92213358a [file] [log] [blame]
Jack Jansen446b3b22001-08-03 14:12:36 +00001"""Test icglue module by printing all preferences. Note that the ic module,
2not the icglue module, is what you should normally use."""
Jack Jansen3beb3361997-01-07 16:17:44 +00003
4import icglue
5import Res
6
7ici = icglue.ICStart('Pyth')
Jack Jansen446b3b22001-08-03 14:12:36 +00008#ici.ICFindConfigFile()
Jack Jansen3beb3361997-01-07 16:17:44 +00009h = Res.Resource("")
10
11ici.ICBegin(1)
12numprefs = ici.ICCountPref()
13print "Number of preferences:", numprefs
14
15for i in range(1, numprefs+1):
16 key = ici.ICGetIndPref(i)
17 print "Key: ", key
18
19 h.data = ""
20 attrs = ici.ICFindPrefHandle(key, h)
21 print "Attr: ", attrs
Jack Jansen4b76ba31997-01-09 16:26:23 +000022 print "Data: ", `h.data[:64]`
Jack Jansen3beb3361997-01-07 16:17:44 +000023
24ici.ICEnd()
25del ici
26
27import sys
28sys.exit(1)