diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-04-01 22:27:18 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-04-01 22:27:18 (GMT) |
commit | 9dd78101d77ca3ff3de2f273b321aeddfa929238 (patch) | |
tree | c4b282f219e3acb795a538bf9453a884c20e5380 /Lib/plat-mac/aetools.py | |
parent | 842273bcd7ad6814a0ce7c1b097cea98615900c4 (diff) | |
download | cpython-9dd78101d77ca3ff3de2f273b321aeddfa929238.zip cpython-9dd78101d77ca3ff3de2f273b321aeddfa929238.tar.gz cpython-9dd78101d77ca3ff3de2f273b321aeddfa929238.tar.bz2 |
Sigh... The get() and set() commands are not declared in the aete for
the Standard_Suite, but various other suites do expect it (the Finder
implements get() without declaring it itself). It is probably another
case of OSA magic. Adding them to the global base class.
Diffstat (limited to 'Lib/plat-mac/aetools.py')
-rw-r--r-- | Lib/plat-mac/aetools.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Lib/plat-mac/aetools.py b/Lib/plat-mac/aetools.py index 9111d50..ac264ee 100644 --- a/Lib/plat-mac/aetools.py +++ b/Lib/plat-mac/aetools.py @@ -254,26 +254,35 @@ class TalkTo: if as: item.__class__ = as return item - - def _set(self, _object, _arguments = {}, _attributes = {}): - """ _set: set data for an object - Required argument: the object - Keyword argument _parameters: Parameter dictionary for the set operation + + get = _get + + _argmap_set = { + 'to' : 'data', + } + + def _set(self, _object, _attributes={}, **_arguments): + """set: Set an object's data. + Required argument: the object for the command + Keyword argument to: The new value. Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the data """ _code = 'core' _subcode = 'setd' - + + keysubst(_arguments, self._argmap_set) _arguments['----'] = _object + _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) - if _arguments.has_key('errn'): + if _arguments.get('errn', 0): raise Error, decodeerror(_arguments) - + # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] + + set = _set # Tiny Finder class, for local use only |