mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Added has_key() method to IC object.
Removed a debug print.
This commit is contained in:
parent
a7a7df0666
commit
871fad2641
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue