Jack Jansen | 446b3b2 | 2001-08-03 14:12:36 +0000 | [diff] [blame] | 1 | """Test icglue module by printing all preferences. Note that the ic module, |
| 2 | not the icglue module, is what you should normally use.""" |
Jack Jansen | 3beb336 | 1997-01-07 16:17:44 +0000 | [diff] [blame] | 3 | |
| 4 | import icglue |
Jack Jansen | 5a6fdcd | 2001-08-25 12:15:04 +0000 | [diff] [blame] | 5 | from Carbon import Res |
Jack Jansen | 3beb336 | 1997-01-07 16:17:44 +0000 | [diff] [blame] | 6 | |
| 7 | ici = icglue.ICStart('Pyth') |
Jack Jansen | 446b3b2 | 2001-08-03 14:12:36 +0000 | [diff] [blame] | 8 | #ici.ICFindConfigFile() |
Jack Jansen | 3beb336 | 1997-01-07 16:17:44 +0000 | [diff] [blame] | 9 | h = Res.Resource("") |
| 10 | |
| 11 | ici.ICBegin(1) |
| 12 | numprefs = ici.ICCountPref() |
| 13 | print "Number of preferences:", numprefs |
| 14 | |
| 15 | for 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 Jansen | 4b76ba3 | 1997-01-09 16:26:23 +0000 | [diff] [blame] | 22 | print "Data: ", `h.data[:64]` |
Jack Jansen | 3beb336 | 1997-01-07 16:17:44 +0000 | [diff] [blame] | 23 | |
| 24 | ici.ICEnd() |
| 25 | del ici |
| 26 | |
| 27 | import sys |
| 28 | sys.exit(1) |