diff options
Diffstat (limited to 'Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py')
-rw-r--r-- | Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py b/Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py index 0f62956..ec064ee 100644 --- a/Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py @@ -12,15 +12,17 @@ _code = 'trmx' class Terminal_Suite_Events: - def run(self, _no_object=None, _attributes={}, **_arguments): - """run: Run the Terminal application + def count(self, _object=None, _attributes={}, **_arguments): + """count: Return the number of elements of a particular class within an object + Required argument: a reference to the objects to be counted Keyword argument _attributes: AppleEvent attribute dictionary + Returns: the number of objects counted """ - _code = 'aevt' - _subcode = 'oapp' + _code = 'core' + _subcode = 'cnte' if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' + _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, @@ -31,15 +33,23 @@ class Terminal_Suite_Events: if _arguments.has_key('----'): return _arguments['----'] - def quit(self, _no_object=None, _attributes={}, **_arguments): - """quit: Quit the Terminal application + _argmap_do_script = { + 'with_command' : 'cmnd', + 'in_' : 'kfil', + } + + def do_script(self, _object, _attributes={}, **_arguments): + """do script: Run a UNIX shell script or command + Required argument: data to be passed to the Terminal application as the command line + Keyword argument with_command: data to be passed to the Terminal application as the command line, deprecated, use direct parameter + Keyword argument in_: the window in which to execute the command Keyword argument _attributes: AppleEvent attribute dictionary """ - _code = 'aevt' - _subcode = 'quit' + _code = 'core' + _subcode = 'dosc' - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' + aetools.keysubst(_arguments, self._argmap_do_script) + _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, @@ -50,17 +60,15 @@ class Terminal_Suite_Events: if _arguments.has_key('----'): return _arguments['----'] - def count(self, _object=None, _attributes={}, **_arguments): - """count: Return the number of elements of a particular class within an object - Required argument: a reference to the objects to be counted + def quit(self, _no_object=None, _attributes={}, **_arguments): + """quit: Quit the Terminal application Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the number of objects counted """ - _code = 'core' - _subcode = 'cnte' + _code = 'aevt' + _subcode = 'quit' if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object + if _no_object != None: raise TypeError, 'No direct arg expected' _reply, _arguments, _attributes = self.send(_code, _subcode, @@ -71,23 +79,15 @@ class Terminal_Suite_Events: if _arguments.has_key('----'): return _arguments['----'] - _argmap_do_script = { - 'with_command' : 'cmnd', - 'in_' : 'kfil', - } - - def do_script(self, _object, _attributes={}, **_arguments): - """do script: Run a UNIX shell script or command - Required argument: data to be passed to the Terminal application as the command line - Keyword argument with_command: data to be passed to the Terminal application as the command line, deprecated, use direct parameter - Keyword argument in_: the window in which to execute the command + def run(self, _no_object=None, _attributes={}, **_arguments): + """run: Run the Terminal application Keyword argument _attributes: AppleEvent attribute dictionary """ - _code = 'core' - _subcode = 'dosc' + _code = 'aevt' + _subcode = 'oapp' - aetools.keysubst(_arguments, self._argmap_do_script) - _arguments['----'] = _object + if _arguments: raise TypeError, 'No optional args expected' + if _no_object != None: raise TypeError, 'No direct arg expected' _reply, _arguments, _attributes = self.send(_code, _subcode, |