summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-07-31 09:39:28 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-07-31 09:39:28 (GMT)
commit871fad2641dbd1d479b5186fde1f56e7ca6cd470 (patch)
treee55d5d06e65afcdc9c43da973337f52ed14959f2 /Mac
parenta7a7df0666f4d69af1026850c46dee59f24debb1 (diff)
downloadcpython-871fad2641dbd1d479b5186fde1f56e7ca6cd470.zip
cpython-871fad2641dbd1d479b5186fde1f56e7ca6cd470.tar.gz
cpython-871fad2641dbd1d479b5186fde1f56e7ca6cd470.tar.bz2
Added has_key() method to IC object.
Removed a debug print.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Lib/ic.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Mac/Lib/ic.py b/Mac/Lib/ic.py
index 6388de5..47091c7 100644
--- a/Mac/Lib/ic.py
+++ b/Mac/Lib/ic.py
@@ -65,7 +65,6 @@ def _decode_fontrecord(data, key):
return size, face, data[5:5+namelen]
def _decode_boolean(data, key):
- print 'XXXX boolean:', `data`
return ord(data[0])
def _decode_text(data, key):
@@ -175,6 +174,13 @@ class IC:
self.ic.ICEnd()
return rv
+ def has_key(self, key):
+ try:
+ dummy = self.ic.ICFindPrefHandle(key, self.h)
+ except icglue.error:
+ return 0
+ return 1
+
def __getitem__(self, key):
attr = self.ic.ICFindPrefHandle(key, self.h)
return _decode(self.h.data, key)