[Python-checkins] python/dist/src/Lib/plat-mac/lib-scriptpackages/Terminal Standard_Suite.py,NONE,1.1 Text_Suite.py,NONE,1.1 Terminal_Suite.py,1.4,1.5 __init__.py,1.4,1.5 Invisible_Suite.py,1.1,NONE
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Fri, 28 Mar 2003 16:13:19 -0800
Update of /cvsroot/python/python/dist/src/Lib/plat-mac/lib-scriptpackages/Terminal
In directory sc8-pr-cvs1:/tmp/cvs-serv7382/Terminal
Modified Files:
Terminal_Suite.py __init__.py
Added Files:
Standard_Suite.py Text_Suite.py
Removed Files:
Invisible_Suite.py
Log Message:
Regenerated with the new way to get terminology (through AppleEvents),
which sometimes seems to result in different terminology. It does
seem to be mostly compatible, though.
--- NEW FILE: Standard_Suite.py ---
"""Suite Standard Suite: Common classes and commands for most applications.
Level 1, version 1
Generated from /Applications/Utilities/Terminal.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = '????'
class Standard_Suite_Events:
_argmap_close = {
'saving_in' : 'kfil',
'saving' : 'savo',
}
def close(self, _object, _attributes={}, **_arguments):
"""close: Close an object.
Required argument: the object for the command
Keyword argument saving_in: The file in which to save the object.
Keyword argument saving: Specifies whether changes should be saved before closing.
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'core'
_subcode = 'clos'
aetools.keysubst(_arguments, self._argmap_close)
_arguments['----'] = _object
aetools.enumsubst(_arguments, 'savo', _Enum_savo)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
_argmap_count = {
'each' : 'kocl',
}
def count(self, _object, _attributes={}, **_arguments):
"""count: Return the number of elements of a particular class within an object.
Required argument: the object for the command
Keyword argument each: The class of objects to be counted.
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the reply for the command
"""
_code = 'core'
_subcode = 'cnte'
aetools.keysubst(_arguments, self._argmap_count)
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
def delete(self, _object, _attributes={}, **_arguments):
"""delete: Delete an object.
Required argument: the object for the command
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'core'
_subcode = 'delo'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
_argmap_duplicate = {
'to' : 'insh',
'with_properties' : 'prdt',
}
def duplicate(self, _object, _attributes={}, **_arguments):
"""duplicate: Copy object(s) and put the copies at a new location.
Required argument: the object for the command
Keyword argument to: The location for the new object(s).
Keyword argument with_properties: Properties to be set in the new duplicated object(s).
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'core'
_subcode = 'clon'
aetools.keysubst(_arguments, self._argmap_duplicate)
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
def exists(self, _object, _attributes={}, **_arguments):
"""exists: Verify if an object exists.
Required argument: the object for the command
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the reply for the command
"""
_code = 'core'
_subcode = 'doex'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
def get(self, _object, _attributes={}, **_arguments):
"""get: Get the data for an object.
Required argument: the object for the command
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the reply for the command
"""
_code = 'core'
_subcode = 'getd'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
_argmap_make = {
'at' : 'insh',
'new' : 'kocl',
'with_data' : 'data',
'with_properties' : 'prdt',
}
def make(self, _no_object=None, _attributes={}, **_arguments):
"""make: Make a new object.
Keyword argument at: The location at which to insert the object.
Keyword argument new: The class of the new object.
Keyword argument with_data: The initial data for the object.
Keyword argument with_properties: The initial values for properties of the object.
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: the reply for the command
"""
_code = 'core'
_subcode = 'crel'
aetools.keysubst(_arguments, self._argmap_make)
if _no_object != None: raise TypeError, 'No direct arg expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
_argmap_move = {
'to' : 'insh',
}
def move(self, _object, _attributes={}, **_arguments):
"""move: Move object(s) to a new location.
Required argument: the object for the command
Keyword argument to: The new location for the object(s).
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'core'
_subcode = 'move'
aetools.keysubst(_arguments, self._argmap_move)
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
def open(self, _object=None, _attributes={}, **_arguments):
"""open: Open an object.
Required argument: list of objects
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'aevt'
_subcode = 'odoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
def print_(self, _object=None, _attributes={}, **_arguments):
"""print: Print an object.
Required argument: list of objects
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'aevt'
_subcode = 'pdoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
_argmap_quit = {
'saving' : 'savo',
}
def quit(self, _object, _attributes={}, **_arguments):
"""quit: Quit an application.
Required argument: the object for the command
Keyword argument saving: Specifies whether changes should be saved before quitting.
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'aevt'
_subcode = 'quit'
aetools.keysubst(_arguments, self._argmap_quit)
_arguments['----'] = _object
aetools.enumsubst(_arguments, 'savo', _Enum_savo)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
_argmap_save = {
'in_' : 'kfil',
'as' : 'fltp',
}
def save(self, _object, _attributes={}, **_arguments):
"""save: Save an object.
Required argument: the object for the command
Keyword argument in_: The file in which to save the object.
Keyword argument as: The file type in which to save the data.
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'core'
_subcode = 'save'
aetools.keysubst(_arguments, self._argmap_save)
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
_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
"""
_code = 'core'
_subcode = 'setd'
aetools.keysubst(_arguments, self._argmap_set)
_arguments['----'] = _object
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
if _arguments.get('errn', 0):
raise aetools.Error, aetools.decodeerror(_arguments)
# XXXX Optionally decode result
if _arguments.has_key('----'):
return _arguments['----']
class application(aetools.ComponentItem):
"""application - An application's top level scripting object. """
want = 'capp'
class _3c_Inheritance_3e_(aetools.NProperty):
"""<Inheritance> - All of the properties of the superclass. """
which = 'c@#^'
want = 'cobj'
class frontmost(aetools.NProperty):
"""frontmost - Is this the frontmost (active) application? """
which = 'pisf'
want = 'bool'
class name(aetools.NProperty):
"""name - The name of the application. """
which = 'pnam'
want = 'utxt'
class version(aetools.NProperty):
"""version - The version of the application. """
which = 'vers'
want = 'utxt'
# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID ']
# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test']
applications = application
class color(aetools.ComponentItem):
"""color - A color. """
want = 'colr'
colors = color
class document(aetools.ComponentItem):
"""document - A document. """
want = 'docu'
class modified(aetools.NProperty):
"""modified - Has the document been modified since the last save? """
which = 'imod'
want = 'bool'
class path(aetools.NProperty):
"""path - The document's path. """
which = 'ppth'
want = 'utxt'
documents = document
class item(aetools.ComponentItem):
"""item - A scriptable object. """
want = 'cobj'
class class_(aetools.NProperty):
"""class - The class of the object. """
which = 'pcls'
want = 'type'
class properties(aetools.NProperty):
"""properties - All of the object's properties. """
which = 'pALL'
want = 'reco'
items = item
class window(aetools.ComponentItem):
"""window - A window. """
want = 'cwin'
class bounds(aetools.NProperty):
"""bounds - The bounding rectangle of the window. """
which = 'pbnd'
want = 'qdrt'
class closeable(aetools.NProperty):
"""closeable - Whether the window has a close box. """
which = 'hclb'
want = 'bool'
class document(aetools.NProperty):
"""document - The document whose contents are being displayed in the window. """
which = 'docu'
want = 'docu'
class floating(aetools.NProperty):
"""floating - Whether the window floats. """
which = 'isfl'
want = 'bool'
class id(aetools.NProperty):
"""id - The unique identifier of the window. """
which = 'ID '
want = 'long'
class index(aetools.NProperty):
"""index - The index of the window in the back-to-front window ordering. """
which = 'pidx'
want = 'long'
class miniaturizable(aetools.NProperty):
"""miniaturizable - Whether the window can be miniaturized. """
which = 'ismn'
want = 'bool'
class miniaturized(aetools.NProperty):
"""miniaturized - Whether the window is currently miniaturized. """
which = 'pmnd'
want = 'bool'
class modal(aetools.NProperty):
"""modal - Whether the window is the application's current modal window. """
which = 'pmod'
want = 'bool'
class resizable(aetools.NProperty):
"""resizable - Whether the window can be resized. """
which = 'prsz'
want = 'bool'
class titled(aetools.NProperty):
"""titled - Whether the window has a title bar. """
which = 'ptit'
want = 'bool'
class visible(aetools.NProperty):
"""visible - Whether the window is currently visible. """
which = 'pvis'
want = 'bool'
class zoomable(aetools.NProperty):
"""zoomable - Whether the window can be zoomed. """
which = 'iszm'
want = 'bool'
class zoomed(aetools.NProperty):
"""zoomed - Whether the window is currently zoomed. """
which = 'pzum'
want = 'bool'
windows = window
application._superclassnames = ['item']
application._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'frontmost' : frontmost,
'name' : name,
'version' : version,
}
application._privelemdict = {
'document' : document,
'window' : window,
}
color._superclassnames = ['item']
color._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
}
color._privelemdict = {
}
document._superclassnames = ['item']
document._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'modified' : modified,
'name' : name,
'path' : path,
}
document._privelemdict = {
}
item._superclassnames = []
item._privpropdict = {
'class_' : class_,
'properties' : properties,
}
item._privelemdict = {
}
window._superclassnames = ['item']
window._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'bounds' : bounds,
'closeable' : closeable,
'document' : document,
'floating' : floating,
'id' : id,
'index' : index,
'miniaturizable' : miniaturizable,
'miniaturized' : miniaturized,
'modal' : modal,
'name' : name,
'resizable' : resizable,
'titled' : titled,
'visible' : visible,
'zoomable' : zoomable,
'zoomed' : zoomed,
}
window._privelemdict = {
}
class _3c_(aetools.NComparison):
"""< - Less than """
class _3d_(aetools.NComparison):
"""= - Equal """
class _3e_(aetools.NComparison):
"""> - Greater than """
class contains(aetools.NComparison):
"""contains - Contains """
class ends_with(aetools.NComparison):
"""ends with - Ends with """
class starts_with(aetools.NComparison):
"""starts with - Starts with """
class _b2_(aetools.NComparison):
"""\xb2 - Less than or equal to """
class _b3_(aetools.NComparison):
"""\xb3 - Greater than or equal to """
_Enum_savo = {
'ask' : 'ask ', # Ask the user whether or not to save the file.
'yes' : 'yes ', # Save the file.
'no' : 'no ', # Do not save the file.
}
#
# Indices of types declared in this module
#
_classdeclarations = {
'capp' : application,
'cobj' : item,
'colr' : color,
'cwin' : window,
'docu' : document,
}
_propdeclarations = {
'ID ' : id,
'c@#^' : _3c_Inheritance_3e_,
'docu' : document,
'hclb' : closeable,
'imod' : modified,
'isfl' : floating,
'ismn' : miniaturizable,
'iszm' : zoomable,
'pALL' : properties,
'pbnd' : bounds,
'pcls' : class_,
'pidx' : index,
'pisf' : frontmost,
'pmnd' : miniaturized,
'pmod' : modal,
'pnam' : name,
'ppth' : path,
'prsz' : resizable,
'ptit' : titled,
'pvis' : visible,
'pzum' : zoomed,
'vers' : version,
}
_compdeclarations = {
'< ' : _3c_,
'<= ' : _b2_,
'= ' : _3d_,
'> ' : _3e_,
'>= ' : _b3_,
'bgwt' : starts_with,
'cont' : contains,
'ends' : ends_with,
}
_enumdeclarations = {
'savo' : _Enum_savo,
}
--- NEW FILE: Text_Suite.py ---
"""Suite Text Suite: A set of basic classes for text processing.
Level 1, version 1
Generated from /Applications/Utilities/Terminal.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = '????'
class Text_Suite_Events:
pass
class attachment(aetools.ComponentItem):
"""attachment - Represents an inline text attachment. This class is used mainly for make commands. """
want = 'atts'
class _3c_Inheritance_3e_(aetools.NProperty):
"""<Inheritance> - All of the properties of the superclass. """
which = 'c@#^'
want = 'ctxt'
class file_name(aetools.NProperty):
"""file name - The path to the file for the attachment """
which = 'atfn'
want = 'utxt'
# element 'catr' as ['indx', 'rele', 'rang', 'test']
# element 'cha ' as ['indx', 'rele', 'rang', 'test']
# element 'cpar' as ['indx', 'rele', 'rang', 'test']
# element 'cwor' as ['indx', 'rele', 'rang', 'test']
class attribute_run(aetools.ComponentItem):
"""attribute run - This subdivides the text into chunks that all have the same attributes. """
want = 'catr'
class color(aetools.NProperty):
"""color - The color of the first character. """
which = 'colr'
want = 'colr'
class font(aetools.NProperty):
"""font - The name of the font of the first character. """
which = 'font'
want = 'utxt'
class size(aetools.NProperty):
"""size - The size in points of the first character. """
which = 'ptsz'
want = 'long'
# element 'catr' as ['indx', 'rele', 'rang', 'test']
# element 'cha ' as ['indx', 'rele', 'rang', 'test']
# element 'cpar' as ['indx', 'rele', 'rang', 'test']
# element 'cwor' as ['indx', 'rele', 'rang', 'test']
attribute_runs = attribute_run
class character(aetools.ComponentItem):
"""character - This subdivides the text into characters. """
want = 'cha '
# element 'catr' as ['indx', 'rele', 'rang', 'test']
# element 'cha ' as ['indx', 'rele', 'rang', 'test']
# element 'cpar' as ['indx', 'rele', 'rang', 'test']
# element 'cwor' as ['indx', 'rele', 'rang', 'test']
characters = character
class paragraph(aetools.ComponentItem):
"""paragraph - This subdivides the text into paragraphs. """
want = 'cpar'
# element 'catr' as ['indx', 'rele', 'rang', 'test']
# element 'cha ' as ['indx', 'rele', 'rang', 'test']
# element 'cpar' as ['indx', 'rele', 'rang', 'test']
# element 'cwor' as ['indx', 'rele', 'rang', 'test']
paragraphs = paragraph
class text(aetools.ComponentItem):
"""text - Rich (styled) text """
want = 'ctxt'
# element 'catr' as ['indx', 'rele', 'rang', 'test']
# element 'cha ' as ['indx', 'rele', 'rang', 'test']
# element 'cpar' as ['indx', 'rele', 'rang', 'test']
# element 'cwor' as ['indx', 'rele', 'rang', 'test']
class word(aetools.ComponentItem):
"""word - This subdivides the text into words. """
want = 'cwor'
# element 'catr' as ['indx', 'rele', 'rang', 'test']
# element 'cha ' as ['indx', 'rele', 'rang', 'test']
# element 'cpar' as ['indx', 'rele', 'rang', 'test']
# element 'cwor' as ['indx', 'rele', 'rang', 'test']
words = word
attachment._superclassnames = ['text']
attachment._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'file_name' : file_name,
}
attachment._privelemdict = {
'attribute_run' : attribute_run,
'character' : character,
'paragraph' : paragraph,
'word' : word,
}
import Standard_Suite
attribute_run._superclassnames = ['item']
attribute_run._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'color' : color,
'font' : font,
'size' : size,
}
attribute_run._privelemdict = {
'attribute_run' : attribute_run,
'character' : character,
'paragraph' : paragraph,
'word' : word,
}
character._superclassnames = ['item']
character._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'color' : color,
'font' : font,
'size' : size,
}
character._privelemdict = {
'attribute_run' : attribute_run,
'character' : character,
'paragraph' : paragraph,
'word' : word,
}
paragraph._superclassnames = ['item']
paragraph._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'color' : color,
'font' : font,
'size' : size,
}
paragraph._privelemdict = {
'attribute_run' : attribute_run,
'character' : character,
'paragraph' : paragraph,
'word' : word,
}
text._superclassnames = ['item']
text._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'color' : color,
'font' : font,
'size' : size,
}
text._privelemdict = {
'attribute_run' : attribute_run,
'character' : character,
'paragraph' : paragraph,
'word' : word,
}
word._superclassnames = ['item']
word._privpropdict = {
'_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'color' : color,
'font' : font,
'size' : size,
}
word._privelemdict = {
'attribute_run' : attribute_run,
'character' : character,
'paragraph' : paragraph,
'word' : word,
}
#
# Indices of types declared in this module
#
_classdeclarations = {
'atts' : attachment,
'catr' : attribute_run,
'cha ' : character,
'cpar' : paragraph,
'ctxt' : text,
'cwor' : word,
}
_propdeclarations = {
'atfn' : file_name,
'c@#^' : _3c_Inheritance_3e_,
'colr' : color,
'font' : font,
'ptsz' : size,
}
_compdeclarations = {
}
_enumdeclarations = {
}
Index: Terminal_Suite.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Terminal_Suite.py 28 Mar 2003 23:38:00 -0000 1.4
--- Terminal_Suite.py 29 Mar 2003 00:13:17 -0000 1.5
***************
*** 2,6 ****
Level 1, version 1
! Generated from /Applications/Utilities/Terminal.app/Contents/Resources/Terminal.rsrc
AETE/AEUT resource version 1/0, language 0, script 0
"""
--- 2,6 ----
Level 1, version 1
! Generated from /Applications/Utilities/Terminal.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
***************
*** 13,24 ****
class Terminal_Suite_Events:
! 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 = 'core'
! _subcode = 'cnte'
if _arguments: raise TypeError, 'No optional args expected'
--- 13,23 ----
class Terminal_Suite_Events:
! def GetURL(self, _object, _attributes={}, **_arguments):
! """GetURL: Opens a telnet: URL
! Required argument: the object for the command
Keyword argument _attributes: AppleEvent attribute dictionary
"""
! _code = 'GURL'
! _subcode = 'GURL'
if _arguments: raise TypeError, 'No optional args expected'
***************
*** 35,48 ****
_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 = 'core'
--- 34,48 ----
_argmap_do_script = {
'in_' : 'kfil',
+ 'with_command' : 'cmnd',
}
def do_script(self, _object, _attributes={}, **_arguments):
"""do script: Run a UNIX shell script or command
! Required argument: the object for the command
Keyword argument in_: the window in which to execute the command
+ Keyword argument with_command: data to be passed to the Terminal application as the command line, deprecated, use direct parameter
Keyword argument _attributes: AppleEvent attribute dictionary
+ Returns: the reply for the command
"""
_code = 'core'
***************
*** 61,119 ****
return _arguments['----']
- def quit(self, _no_object=None, _attributes={}, **_arguments):
- """quit: Quit the Terminal application
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'aevt'
- _subcode = 'quit'
-
- 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,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- def run(self, _no_object=None, _attributes={}, **_arguments):
- """run: Run the Terminal application
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'aevt'
- _subcode = 'oapp'
-
- 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,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
class application(aetools.ComponentItem):
"""application - The Terminal program """
want = 'capp'
! class frontmost(aetools.NProperty):
! """frontmost - Is this the active application? """
! which = 'pisf'
! want = 'bool'
! class name(aetools.NProperty):
! """name - the name of the application """
! which = 'pnam'
! want = 'TEXT'
! class version(aetools.NProperty):
! """version - the version of the application """
! which = 'vers'
! want = 'vers'
! # element 'cwin' as ['name', 'indx']
applications = application
--- 61,78 ----
return _arguments['----']
class application(aetools.ComponentItem):
"""application - The Terminal program """
want = 'capp'
! class _3c_Inheritance_3e_(aetools.NProperty):
! """<Inheritance> - All of the properties of the superclass. """
! which = 'c@#^'
! want = 'capp'
! class properties(aetools.NProperty):
! """properties - every property of the Terminal program """
! which = 'pALL'
! want = '****'
! # element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID ']
! # element 'docu' as ['name', 'indx', 'rele', 'rang', 'test']
applications = application
***************
*** 125,137 ****
"""background color - the background color for the window """
which = 'pbcl'
! want = 'TEXT'
class bold_text_color(aetools.NProperty):
"""bold text color - the bold text color for the window """
which = 'pbtc'
! want = 'TEXT'
class bounds(aetools.NProperty):
"""bounds - the boundary rectangle for the window, relative to the upper left corner of the screen """
which = 'pbnd'
! want = 'qdrt'
class busy(aetools.NProperty):
"""busy - Is the window busy running a process? """
--- 84,96 ----
"""background color - the background color for the window """
which = 'pbcl'
! want = '****'
class bold_text_color(aetools.NProperty):
"""bold text color - the bold text color for the window """
which = 'pbtc'
! want = '****'
class bounds(aetools.NProperty):
"""bounds - the boundary rectangle for the window, relative to the upper left corner of the screen """
which = 'pbnd'
! want = '****'
class busy(aetools.NProperty):
"""busy - Is the window busy running a process? """
***************
*** 141,193 ****
"""contents - the currently visible contents of the window """
which = 'pcnt'
! want = 'TEXT'
class cursor_color(aetools.NProperty):
"""cursor color - the cursor color for the window """
which = 'pcuc'
! want = 'TEXT'
class custom_title(aetools.NProperty):
"""custom title - the custom title for the window """
which = 'titl'
! want = 'TEXT'
! class floating(aetools.NProperty):
! """floating - Does the window float? """
! which = 'isfl'
! want = 'bool'
class frame(aetools.NProperty):
"""frame - the origin and size of the window """
which = 'pfra'
! want = 'list'
! class has_close_box(aetools.NProperty):
! """has close box - Does the window have a close box? """
! which = 'hclb'
! want = 'bool'
! class has_title_bar(aetools.NProperty):
! """has title bar - Does the window have a title bar? """
! which = 'ptit'
want = 'bool'
class history(aetools.NProperty):
"""history - the contents of the entire scrolling buffer of the window """
which = 'hist'
! want = 'TEXT'
! class index(aetools.NProperty):
! """index - the number of the window """
! which = 'pidx'
! want = 'long'
! class miniaturizable(aetools.NProperty):
! """miniaturizable - Is the window miniaturizable? """
! which = 'ismn'
! want = 'bool'
! class miniaturized(aetools.NProperty):
! """miniaturized - Is the window miniaturized? """
! which = 'pmnd'
! want = 'bool'
! class modal(aetools.NProperty):
! """modal - Is the window modal? """
! which = 'pmod'
! want = 'bool'
class normal_text_color(aetools.NProperty):
"""normal text color - the normal text color for the window """
which = 'ptxc'
! want = 'TEXT'
class number_of_columns(aetools.NProperty):
"""number of columns - the number of columns in the window """
--- 100,128 ----
"""contents - the currently visible contents of the window """
which = 'pcnt'
! want = 'utxt'
class cursor_color(aetools.NProperty):
"""cursor color - the cursor color for the window """
which = 'pcuc'
! want = '****'
class custom_title(aetools.NProperty):
"""custom title - the custom title for the window """
which = 'titl'
! want = 'utxt'
class frame(aetools.NProperty):
"""frame - the origin and size of the window """
which = 'pfra'
! want = '****'
! class frontmost(aetools.NProperty):
! """frontmost - Is the window in front of the other Terminal windows? """
! which = 'pisf'
want = 'bool'
class history(aetools.NProperty):
"""history - the contents of the entire scrolling buffer of the window """
which = 'hist'
! want = 'utxt'
class normal_text_color(aetools.NProperty):
"""normal text color - the normal text color for the window """
which = 'ptxc'
! want = '****'
class number_of_columns(aetools.NProperty):
"""number of columns - the number of columns in the window """
***************
*** 201,221 ****
"""origin - the lower left coordinates of the window, relative to the lower left corner of the screen """
which = 'pori'
! want = 'list'
class position(aetools.NProperty):
"""position - the upper left coordinates of the window, relative to the upper left corner of the screen """
which = 'ppos'
! want = 'QDpt'
class processes(aetools.NProperty):
"""processes - a list of the currently running processes """
which = 'prcs'
! want = 'list'
! class resizable(aetools.NProperty):
! """resizable - Is the window resizable? """
! which = 'prsz'
! want = 'bool'
class size(aetools.NProperty):
"""size - the width and height of the window """
which = 'psiz'
! want = 'list'
class title_displays_custom_title(aetools.NProperty):
"""title displays custom title - Does the title for the window contain a custom title? """
--- 136,152 ----
"""origin - the lower left coordinates of the window, relative to the lower left corner of the screen """
which = 'pori'
! want = '****'
class position(aetools.NProperty):
"""position - the upper left coordinates of the window, relative to the upper left corner of the screen """
which = 'ppos'
! want = '****'
class processes(aetools.NProperty):
"""processes - a list of the currently running processes """
which = 'prcs'
! want = 'utxt'
class size(aetools.NProperty):
"""size - the width and height of the window """
which = 'psiz'
! want = '****'
class title_displays_custom_title(aetools.NProperty):
"""title displays custom title - Does the title for the window contain a custom title? """
***************
*** 238,266 ****
which = 'tdws'
want = 'bool'
- class visible(aetools.NProperty):
- """visible - Is the window visible? """
- which = 'pvis'
- want = 'bool'
- class zoomable(aetools.NProperty):
- """zoomable - Is the window zoomable? """
- which = 'iszm'
- want = 'bool'
- class zoomed(aetools.NProperty):
- """zoomed - Is the window zoomed? """
- which = 'pzum'
- want = 'bool'
windows = window
application._superclassnames = []
application._privpropdict = {
! 'frontmost' : frontmost,
! 'name' : name,
! 'version' : version,
}
application._privelemdict = {
'window' : window,
}
window._superclassnames = []
window._privpropdict = {
'background_color' : background_color,
'bold_text_color' : bold_text_color,
--- 169,187 ----
which = 'tdws'
want = 'bool'
windows = window
application._superclassnames = []
+ import Standard_Suite
application._privpropdict = {
! '_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
! 'properties' : properties,
}
application._privelemdict = {
+ 'document' : Standard_Suite.document,
'window' : window,
}
window._superclassnames = []
window._privpropdict = {
+ '_3c_Inheritance_3e_' : _3c_Inheritance_3e_,
'background_color' : background_color,
'bold_text_color' : bold_text_color,
***************
*** 270,284 ****
'cursor_color' : cursor_color,
'custom_title' : custom_title,
- 'floating' : floating,
'frame' : frame,
'frontmost' : frontmost,
- 'has_close_box' : has_close_box,
- 'has_title_bar' : has_title_bar,
'history' : history,
- 'index' : index,
- 'miniaturizable' : miniaturizable,
- 'miniaturized' : miniaturized,
- 'modal' : modal,
- 'name' : name,
'normal_text_color' : normal_text_color,
'number_of_columns' : number_of_columns,
--- 191,197 ----
***************
*** 287,291 ****
'position' : position,
'processes' : processes,
! 'resizable' : resizable,
'size' : size,
'title_displays_custom_title' : title_displays_custom_title,
--- 200,204 ----
'position' : position,
'processes' : processes,
! 'properties' : properties,
'size' : size,
'title_displays_custom_title' : title_displays_custom_title,
***************
*** 294,300 ****
'title_displays_shell_path' : title_displays_shell_path,
'title_displays_window_size' : title_displays_window_size,
- 'visible' : visible,
- 'zoomable' : zoomable,
- 'zoomed' : zoomed,
}
window._privelemdict = {
--- 207,210 ----
***************
*** 311,321 ****
_propdeclarations = {
'busy' : busy,
'ccol' : number_of_columns,
'crow' : number_of_rows,
- 'hclb' : has_close_box,
'hist' : history,
! 'isfl' : floating,
! 'ismn' : miniaturizable,
! 'iszm' : zoomable,
'pbcl' : background_color,
'pbnd' : bounds,
--- 221,229 ----
_propdeclarations = {
'busy' : busy,
+ 'c@#^' : _3c_Inheritance_3e_,
'ccol' : number_of_columns,
'crow' : number_of_rows,
'hist' : history,
! 'pALL' : properties,
'pbcl' : background_color,
'pbnd' : bounds,
***************
*** 324,341 ****
'pcuc' : cursor_color,
'pfra' : frame,
- 'pidx' : index,
'pisf' : frontmost,
- 'pmnd' : miniaturized,
- 'pmod' : modal,
- 'pnam' : name,
'pori' : origin,
'ppos' : position,
'prcs' : processes,
- 'prsz' : resizable,
'psiz' : size,
- 'ptit' : has_title_bar,
'ptxc' : normal_text_color,
- 'pvis' : visible,
- 'pzum' : zoomed,
'tdct' : title_displays_custom_title,
'tddn' : title_displays_device_name,
--- 232,241 ----
***************
*** 344,348 ****
'tdws' : title_displays_window_size,
'titl' : custom_title,
- 'vers' : version,
}
--- 244,247 ----
Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/lib-scriptpackages/Terminal/__init__.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** __init__.py 28 Mar 2003 23:38:00 -0000 1.4
--- __init__.py 29 Mar 2003 00:13:17 -0000 1.5
***************
*** 1,14 ****
"""
! Package generated from /Applications/Utilities/Terminal.app/Contents/Resources/Terminal.rsrc
! Resource aete resid 0 Terminal Terminology
"""
import aetools
Error = aetools.Error
! import Invisible_Suite
import Terminal_Suite
_code_to_module = {
! 'tpnm' : Invisible_Suite,
'trmx' : Terminal_Suite,
}
--- 1,15 ----
"""
! Package generated from /Applications/Utilities/Terminal.app
"""
import aetools
Error = aetools.Error
! import Standard_Suite
! import Text_Suite
import Terminal_Suite
_code_to_module = {
! '????' : Standard_Suite,
! '????' : Text_Suite,
'trmx' : Terminal_Suite,
}
***************
*** 17,25 ****
_code_to_fullname = {
! 'tpnm' : ('Terminal.Invisible_Suite', 'Invisible_Suite'),
'trmx' : ('Terminal.Terminal_Suite', 'Terminal_Suite'),
}
! from Invisible_Suite import *
from Terminal_Suite import *
--- 18,28 ----
_code_to_fullname = {
! '????' : ('Terminal.Standard_Suite', 'Standard_Suite'),
! '????' : ('Terminal.Text_Suite', 'Text_Suite'),
'trmx' : ('Terminal.Terminal_Suite', 'Terminal_Suite'),
}
! from Standard_Suite import *
! from Text_Suite import *
from Terminal_Suite import *
***************
*** 43,87 ****
getbaseclasses(window)
getbaseclasses(application)
getbaseclasses(application)
! getbaseclasses(StdSuites.Type_Names_Suite.small_integer)
! getbaseclasses(StdSuites.Type_Names_Suite.RGB16_color)
! getbaseclasses(StdSuites.Type_Names_Suite.system_dictionary)
! getbaseclasses(StdSuites.Type_Names_Suite.color_table)
! getbaseclasses(StdSuites.Type_Names_Suite.fixed_point)
! getbaseclasses(StdSuites.Type_Names_Suite.plain_text)
! getbaseclasses(StdSuites.Type_Names_Suite.type_element_info)
! getbaseclasses(StdSuites.Type_Names_Suite.location_reference)
! getbaseclasses(StdSuites.Type_Names_Suite.version)
! getbaseclasses(StdSuites.Type_Names_Suite.PostScript_picture)
! getbaseclasses(StdSuites.Type_Names_Suite.machine_location)
! getbaseclasses(StdSuites.Type_Names_Suite.menu_item)
! getbaseclasses(StdSuites.Type_Names_Suite.pixel_map_record)
! getbaseclasses(StdSuites.Type_Names_Suite.application_dictionary)
! getbaseclasses(StdSuites.Type_Names_Suite.unsigned_integer)
! getbaseclasses(StdSuites.Type_Names_Suite.menu)
! getbaseclasses(StdSuites.Type_Names_Suite.fixed_rectangle)
! getbaseclasses(StdSuites.Type_Names_Suite.long_fixed_rectangle)
! getbaseclasses(StdSuites.Type_Names_Suite.type_event_info)
! getbaseclasses(StdSuites.Type_Names_Suite.small_real)
! getbaseclasses(StdSuites.Type_Names_Suite.type_suite_info)
! getbaseclasses(StdSuites.Type_Names_Suite.rotation)
! getbaseclasses(StdSuites.Type_Names_Suite.fixed)
! getbaseclasses(StdSuites.Type_Names_Suite.scrap_styles)
! getbaseclasses(StdSuites.Type_Names_Suite.long_point)
! getbaseclasses(StdSuites.Type_Names_Suite.type_class_info)
! getbaseclasses(StdSuites.Type_Names_Suite.TIFF_picture)
! getbaseclasses(StdSuites.Type_Names_Suite.RGB96_color)
! getbaseclasses(StdSuites.Type_Names_Suite.dash_style)
! getbaseclasses(StdSuites.Type_Names_Suite.type_property_info)
! getbaseclasses(StdSuites.Type_Names_Suite.type_parameter_info)
! getbaseclasses(StdSuites.Type_Names_Suite.long_fixed_point)
! getbaseclasses(StdSuites.Type_Names_Suite.long_rectangle)
! getbaseclasses(StdSuites.Type_Names_Suite.extended_real)
! getbaseclasses(StdSuites.Type_Names_Suite.double_integer)
! getbaseclasses(StdSuites.Type_Names_Suite.long_fixed)
! getbaseclasses(StdSuites.Type_Names_Suite.null)
! getbaseclasses(StdSuites.Type_Names_Suite.target_id)
! getbaseclasses(StdSuites.Type_Names_Suite.point)
! getbaseclasses(StdSuites.Type_Names_Suite.bounding_rectangle)
#
--- 46,60 ----
getbaseclasses(window)
getbaseclasses(application)
+ getbaseclasses(character)
+ getbaseclasses(attachment)
+ getbaseclasses(paragraph)
+ getbaseclasses(word)
+ getbaseclasses(attribute_run)
+ getbaseclasses(text)
+ getbaseclasses(color)
+ getbaseclasses(window)
getbaseclasses(application)
! getbaseclasses(item)
! getbaseclasses(document)
#
***************
*** 91,139 ****
'cwin' : window,
'capp' : application,
'capp' : application,
! 'shor' : StdSuites.Type_Names_Suite.small_integer,
! 'tr16' : StdSuites.Type_Names_Suite.RGB16_color,
! 'aeut' : StdSuites.Type_Names_Suite.system_dictionary,
! 'clrt' : StdSuites.Type_Names_Suite.color_table,
! 'fpnt' : StdSuites.Type_Names_Suite.fixed_point,
! 'TEXT' : StdSuites.Type_Names_Suite.plain_text,
! 'elin' : StdSuites.Type_Names_Suite.type_element_info,
! 'insl' : StdSuites.Type_Names_Suite.location_reference,
! 'vers' : StdSuites.Type_Names_Suite.version,
! 'EPS ' : StdSuites.Type_Names_Suite.PostScript_picture,
! 'mLoc' : StdSuites.Type_Names_Suite.machine_location,
! 'cmen' : StdSuites.Type_Names_Suite.menu_item,
! 'tpmm' : StdSuites.Type_Names_Suite.pixel_map_record,
! 'aete' : StdSuites.Type_Names_Suite.application_dictionary,
! 'magn' : StdSuites.Type_Names_Suite.unsigned_integer,
! 'cmnu' : StdSuites.Type_Names_Suite.menu,
! 'frct' : StdSuites.Type_Names_Suite.fixed_rectangle,
! 'lfrc' : StdSuites.Type_Names_Suite.long_fixed_rectangle,
! 'evin' : StdSuites.Type_Names_Suite.type_event_info,
! 'sing' : StdSuites.Type_Names_Suite.small_real,
! 'suin' : StdSuites.Type_Names_Suite.type_suite_info,
! 'trot' : StdSuites.Type_Names_Suite.rotation,
! 'fixd' : StdSuites.Type_Names_Suite.fixed,
! 'styl' : StdSuites.Type_Names_Suite.scrap_styles,
! 'lpnt' : StdSuites.Type_Names_Suite.long_point,
! 'gcli' : StdSuites.Type_Names_Suite.type_class_info,
! 'TIFF' : StdSuites.Type_Names_Suite.TIFF_picture,
! 'tr96' : StdSuites.Type_Names_Suite.RGB96_color,
! 'tdas' : StdSuites.Type_Names_Suite.dash_style,
! 'pinf' : StdSuites.Type_Names_Suite.type_property_info,
! 'pmin' : StdSuites.Type_Names_Suite.type_parameter_info,
! 'lfpt' : StdSuites.Type_Names_Suite.long_fixed_point,
! 'lrct' : StdSuites.Type_Names_Suite.long_rectangle,
! 'exte' : StdSuites.Type_Names_Suite.extended_real,
! 'comp' : StdSuites.Type_Names_Suite.double_integer,
! 'lfxd' : StdSuites.Type_Names_Suite.long_fixed,
! 'null' : StdSuites.Type_Names_Suite.null,
! 'targ' : StdSuites.Type_Names_Suite.target_id,
! 'QDpt' : StdSuites.Type_Names_Suite.point,
! 'qdrt' : StdSuites.Type_Names_Suite.bounding_rectangle,
}
! class Terminal(Invisible_Suite_Events,
Terminal_Suite_Events,
aetools.TalkTo):
--- 64,83 ----
'cwin' : window,
'capp' : application,
+ 'cha ' : character,
+ 'atts' : attachment,
+ 'cpar' : paragraph,
+ 'cwor' : word,
+ 'catr' : attribute_run,
+ 'ctxt' : text,
+ 'colr' : color,
+ 'cwin' : window,
'capp' : application,
! 'cobj' : item,
! 'docu' : document,
}
! class Terminal(Standard_Suite_Events,
! Text_Suite_Events,
Terminal_Suite_Events,
aetools.TalkTo):
--- Invisible_Suite.py DELETED ---