summaryrefslogtreecommitdiffstats
path: root/Mac/Lib
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-01-29 15:45:09 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-01-29 15:45:09 (GMT)
commit7e156a70fa5a26e11c50f2d5bff44935345c4ea9 (patch)
tree2f353d6b69675600c4bf6aecfb141dd573b43641 /Mac/Lib
parentbdd0747193e9e08d94e146f65254a885bdb6178b (diff)
downloadcpython-7e156a70fa5a26e11c50f2d5bff44935345c4ea9.zip
cpython-7e156a70fa5a26e11c50f2d5bff44935345c4ea9.tar.gz
cpython-7e156a70fa5a26e11c50f2d5bff44935345c4ea9.tar.bz2
Added missing get() method
Diffstat (limited to 'Mac/Lib')
-rw-r--r--Mac/Lib/toolbox/aetools.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Mac/Lib/toolbox/aetools.py b/Mac/Lib/toolbox/aetools.py
index 68eb825..72e5475 100644
--- a/Mac/Lib/toolbox/aetools.py
+++ b/Mac/Lib/toolbox/aetools.py
@@ -154,9 +154,33 @@ class TalkTo:
"""Send an appleevent given code/subcode/pars/attrs and unpack the reply"""
return self.sendevent(self.newevent(code, subcode, parameters, attributes))
+ #
+ # The following events are somehow "standard" and don't seem to appear in any
+ # suite...
+ #
def activate(self):
"""Send 'activate' command"""
self.send('misc', 'actv')
+
+ def get(self, _object, _attributes={}):
+ """get: get data from an object
+ Required argument: the object
+ Keyword argument _attributes: AppleEvent attribute dictionary
+ Returns: the data
+ """
+ _code = 'core'
+ _subcode = 'getd'
+
+ _arguments = {'----':_object}
+
+
+ _reply, _arguments, _attributes = self.send(_code, _subcode,
+ _arguments, _attributes)
+ if _arguments.has_key('errn'):
+ raise MacOS.Error, decodeerror(_arguments)
+
+ if _arguments.has_key('----'):
+ return _arguments['----']
# Test program