blob: dd34bd033bea695a318d0f0db0839a9d30f23d54 [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
Jack Jansen5a6fdcd2001-08-25 12:15:04 +00005from Carbon import Res
Jack Jansen3beb3361997-01-07 16:17:44 +00006
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)