summaryrefslogtreecommitdiffstats
path: root/Mac/Lib/lib-toolbox/aetools.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-08-20 19:42:52 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-08-20 19:42:52 (GMT)
commit2eda24475c46448b8eab09509fc921b31f87cc13 (patch)
tree45db9c0eec56f494642c8aef4b524963a187ebb4 /Mac/Lib/lib-toolbox/aetools.py
parent12b2b76608e7551e3b5ce5c5db98d0b59ff75056 (diff)
downloadcpython-2eda24475c46448b8eab09509fc921b31f87cc13.zip
cpython-2eda24475c46448b8eab09509fc921b31f87cc13.tar.gz
cpython-2eda24475c46448b8eab09509fc921b31f87cc13.tar.bz2
Enums we cannot find are set to None, and enumsubst understands this (no substitution done). This is need for what I think are bugs in the Finder aete resources (some events use unknown enums).
Diffstat (limited to 'Mac/Lib/lib-toolbox/aetools.py')
-rw-r--r--Mac/Lib/lib-toolbox/aetools.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Mac/Lib/lib-toolbox/aetools.py b/Mac/Lib/lib-toolbox/aetools.py
index 792cb72..42b6b76 100644
--- a/Mac/Lib/lib-toolbox/aetools.py
+++ b/Mac/Lib/lib-toolbox/aetools.py
@@ -103,7 +103,7 @@ def keysubst(arguments, keydict):
def enumsubst(arguments, key, edict):
"""Substitute a single enum keyword argument, if it occurs"""
- if not arguments.has_key(key):
+ if not arguments.has_key(key) or edict is None:
return
v = arguments[key]
ok = edict.values()
@@ -129,8 +129,9 @@ def decodeerror(arguments):
class TalkTo:
"""An AE connection to an application"""
+ _signature = None # Can be overridden by subclasses
- def __init__(self, signature, start=0, timeout=0):
+ def __init__(self, signature=None, start=0, timeout=0):
"""Create a communication channel with a particular application.
Addressing the application is done by specifying either a
@@ -138,6 +139,8 @@ class TalkTo:
to an AEDesc.
"""
self.target_signature = None
+ if signature is None:
+ signature = self._signature
if type(signature) == AEDescType:
self.target = signature
elif type(signature) == InstanceType and hasattr(signature, '__aepack__'):