summaryrefslogtreecommitdiffstats
path: root/Mac/Lib
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1997-01-10 15:25:47 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1997-01-10 15:25:47 (GMT)
commit8dc797d1f888b3ebfb1af5fdb97c1a4fc11026cb (patch)
tree02a8fdc693920fb5cf9d816cb7cb404b157ea8aa /Mac/Lib
parent466be801fd821e88059f718b72aec961c889e0a0 (diff)
downloadcpython-8dc797d1f888b3ebfb1af5fdb97c1a4fc11026cb.zip
cpython-8dc797d1f888b3ebfb1af5fdb97c1a4fc11026cb.tar.gz
cpython-8dc797d1f888b3ebfb1af5fdb97c1a4fc11026cb.tar.bz2
Return preferences of unknown type as opaque data
Diffstat (limited to 'Mac/Lib')
-rw-r--r--Mac/Lib/ic.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Mac/Lib/ic.py b/Mac/Lib/ic.py
index 9089f52..6388de5 100644
--- a/Mac/Lib/ic.py
+++ b/Mac/Lib/ic.py
@@ -28,13 +28,24 @@ icReadOnlyPerm = 1
icReadWritePerm = 2
# End of ictypes.h
+class ICOpaqueData:
+ """An unparseable IC entry"""
+ def __init__(self, data):
+ self.data = data
+
+ def __repr__(self):
+ return "ICOpaqueData(%s)"%`self.data`
+
+_ICOpaqueDataType=type(ICOpaqueData(''))
+
def _decode_default(data, key):
if len(data) == 0:
return data
if ord(data[0]) == len(data)-1:
# Assume Pstring
return data[1:]
- raise error, "Unknown data format for key "+key
+ return ICOpaqueData(data)
+
def _decode_multistr(data, key):
numstr = ord(data[0]) << 8 | ord(data[1])
@@ -134,6 +145,8 @@ def _decode(data, key):
return decoder(data, key)
def _code(data, key):
+ if type(data) == _ICOpaqueDataType:
+ return data.data
if '\245' in key:
key2 = key[:string.index(key, '\245')+1]
else: