summaryrefslogtreecommitdiffstats
path: root/Mac/Lib/toolbox/aetools.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1997-08-08 15:00:03 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1997-08-08 15:00:03 (GMT)
commit756a69fa0d3266e55537cfcf580dd4b1dc8617ea (patch)
treecdb4a67c856de2cfb5f5fe887cdfd90340240dc8 /Mac/Lib/toolbox/aetools.py
parenta8441ded7a202c6c06c94d86da0b6f68baea2c1f (diff)
downloadcpython-756a69fa0d3266e55537cfcf580dd4b1dc8617ea.zip
cpython-756a69fa0d3266e55537cfcf580dd4b1dc8617ea.tar.gz
cpython-756a69fa0d3266e55537cfcf580dd4b1dc8617ea.tar.bz2
- Added classes to support class/property generation by gensuitemodule
- Fixed Property class: selector is a 'type', not an 'enum'
Diffstat (limited to 'Mac/Lib/toolbox/aetools.py')
-rw-r--r--Mac/Lib/toolbox/aetools.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/Mac/Lib/toolbox/aetools.py b/Mac/Lib/toolbox/aetools.py
index 41b7f24..21a4237 100644
--- a/Mac/Lib/toolbox/aetools.py
+++ b/Mac/Lib/toolbox/aetools.py
@@ -107,14 +107,17 @@ def enumsubst(arguments, key, edict):
def decodeerror(arguments):
"""Create the 'best' argument for a raise MacOS.Error"""
errn = arguments['errn']
- errarg = (errn, )
+ err_a1 = errn
if arguments.has_key('errs'):
- errarg = errarg + (arguments['errs'],)
+ err_a2 = arguments['errs']
+ else:
+ err_a2 = MacOS.GetErrorString(errn)
if arguments.has_key('erob'):
- errarg = errarg + (arguments['erob'],)
- if len(errarg) == 1:
- errarg = errarg + ('Server returned error code %d'%errn, )
- return errarg
+ err_a3 = arguments['erob']
+ else:
+ err_a3 = None
+
+ return (err_a1, err_a2, err_a3)
class TalkTo:
"""An AE connection to an application"""
@@ -178,8 +181,8 @@ class TalkTo:
"""Send 'activate' command"""
self.send('misc', 'actv')
- def get(self, _object, _attributes={}):
- """get: get data from an object
+ def _get(self, _object, as=None, _attributes={}):
+ """_get: get data from an object
Required argument: the object
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the data
@@ -188,7 +191,8 @@ class TalkTo:
_subcode = 'getd'
_arguments = {'----':_object}
-
+ if as:
+ _arguments['rtyp'] = mktype(as)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)