home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Python 1.4 / ic / icgluetest.py < prev    next >
Encoding:
Python Source  |  1997-01-10  |  471 b   |  28 lines  |  [TEXT/Pyth]

  1. """Test icglue module by printing all preferences"""
  2.  
  3. import icglue
  4. import Res
  5.  
  6. ici = icglue.ICStart('Pyth')
  7. ici.ICFindConfigFile()
  8. h = Res.Resource("")
  9.  
  10. ici.ICBegin(1)
  11. numprefs = ici.ICCountPref()
  12. print "Number of preferences:", numprefs
  13.  
  14. for i in range(1, numprefs+1):
  15.     key = ici.ICGetIndPref(i)
  16.     print "Key:  ", key
  17.     
  18.     h.data = ""
  19.     attrs = ici.ICFindPrefHandle(key, h)
  20.     print "Attr: ", attrs
  21.     print "Data: ", `h.data[:64]`
  22.  
  23. ici.ICEnd()
  24. del ici
  25.  
  26. import sys
  27. sys.exit(1)
  28.