1 """Suite Terminal Suite: Terms and Events for controlling the Terminal application
4 Generated from /Applications/Utilities/Terminal.app/Contents/Resources/Terminal.rsrc
5 AETE/AEUT resource version 1/0, language 0, script 0
13 class Terminal_Suite_Events
:
15 def run(self
, _no_object
=None, _attributes
={}, **_arguments
):
16 """run: Run the Terminal application
17 Keyword argument _attributes: AppleEvent attribute dictionary
22 if _arguments
: raise TypeError, 'No optional args expected'
23 if _no_object
!= None: raise TypeError, 'No direct arg expected'
26 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
27 _arguments
, _attributes
)
28 if _arguments
.get('errn', 0):
29 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
30 # XXXX Optionally decode result
31 if _arguments
.has_key('----'):
32 return _arguments
['----']
34 def quit(self
, _no_object
=None, _attributes
={}, **_arguments
):
35 """quit: Quit the Terminal application
36 Keyword argument _attributes: AppleEvent attribute dictionary
41 if _arguments
: raise TypeError, 'No optional args expected'
42 if _no_object
!= None: raise TypeError, 'No direct arg expected'
45 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
46 _arguments
, _attributes
)
47 if _arguments
.get('errn', 0):
48 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
49 # XXXX Optionally decode result
50 if _arguments
.has_key('----'):
51 return _arguments
['----']
53 def count(self
, _object
=None, _attributes
={}, **_arguments
):
54 """count: Return the number of elements of a particular class within an object
55 Required argument: a reference to the objects to be counted
56 Keyword argument _attributes: AppleEvent attribute dictionary
57 Returns: the number of objects counted
62 if _arguments
: raise TypeError, 'No optional args expected'
63 _arguments
['----'] = _object
66 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
67 _arguments
, _attributes
)
68 if _arguments
.get('errn', 0):
69 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
70 # XXXX Optionally decode result
71 if _arguments
.has_key('----'):
72 return _arguments
['----']
75 'with_command' : 'cmnd',
78 def do_script(self
, _no_object
=None, _attributes
={}, **_arguments
):
79 """do script: Run a UNIX shell script or command
80 Keyword argument with_command: data to be passed to the Terminal application as the command line
81 Keyword argument _attributes: AppleEvent attribute dictionary
86 aetools
.keysubst(_arguments
, self
._argmap
_do
_script
)
87 if _no_object
!= None: raise TypeError, 'No direct arg expected'
90 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
91 _arguments
, _attributes
)
92 if _arguments
.get('errn', 0):
93 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
94 # XXXX Optionally decode result
95 if _arguments
.has_key('----'):
96 return _arguments
['----']
99 class application(aetools
.ComponentItem
):
100 """application - The Terminal program """
102 class name(aetools
.NProperty
):
103 """name - the name of the application """
106 class version(aetools
.NProperty
):
107 """version - the version of the application """
110 class frontmost(aetools
.NProperty
):
111 """frontmost - Is this the active application? """
114 # element 'cwin' as ['name', 'indx']
116 applications
= application
118 class window(aetools
.ComponentItem
):
119 """window - A Terminal window """
121 class index(aetools
.NProperty
):
122 """index - the number of the window """
125 class visible(aetools
.NProperty
):
126 """visible - Is the window visible? """
129 class has_close_box(aetools
.NProperty
):
130 """has close box - Does the window have a close box? """
133 class has_title_bar(aetools
.NProperty
):
134 """has title bar - Does the window have a title bar? """
137 class floating(aetools
.NProperty
):
138 """floating - Does the window float? """
141 class modal(aetools
.NProperty
):
142 """modal - Is the window modal? """
145 class resizable(aetools
.NProperty
):
146 """resizable - Is the window resizable? """
149 class zoomable(aetools
.NProperty
):
150 """zoomable - Is the window zoomable? """
153 class zoomed(aetools
.NProperty
):
154 """zoomed - Is the window zoomed? """
157 class miniaturizable(aetools
.NProperty
):
158 """miniaturizable - Is the window miniaturizable? """
161 class miniaturized(aetools
.NProperty
):
162 """miniaturized - Is the window miniaturized? """
165 class position(aetools
.NProperty
):
166 """position - the upper left coordinates of window """
169 class bounds(aetools
.NProperty
):
170 """bounds - the boundary rectangle for the window """
173 class title_displays_device_name(aetools
.NProperty
):
174 """title displays device name - Does the title for the window contain the device name? """
177 class title_displays_shell_path(aetools
.NProperty
):
178 """title displays shell path - Does the title for the window contain the shell path? """
181 class title_displays_window_size(aetools
.NProperty
):
182 """title displays window size - Does the title for the window contain the window size? """
185 class title_displays_file_name(aetools
.NProperty
):
186 """title displays file name - Does the title for the window contain the file name? """
189 class title_displays_custom_title(aetools
.NProperty
):
190 """title displays custom title - Does the title for the window contain a custom title? """
193 class custom_title(aetools
.NProperty
):
194 """custom title - the custom title for the window """
197 class contents(aetools
.NProperty
):
198 """contents - the currently visible contents of the window """
201 class history(aetools
.NProperty
):
202 """history - the contents of the entire scrolling buffer of the window """
205 class number_of_rows(aetools
.NProperty
):
206 """number of rows - the number of rows in the window """
209 class number_of_columns(aetools
.NProperty
):
210 """number of columns - the number of columns in the window """
213 class cursor_color(aetools
.NProperty
):
214 """cursor color - the cursor color for the window """
217 class background_color(aetools
.NProperty
):
218 """background color - the background color for the window """
221 class normal_text_color(aetools
.NProperty
):
222 """normal text color - the normal text color for the window """
225 class bold_text_color(aetools
.NProperty
):
226 """bold text color - the bold text color for the window """
231 application
._propdict
= {
234 'frontmost' : frontmost
,
236 application
._elemdict
= {
243 'has_close_box' : has_close_box
,
244 'has_title_bar' : has_title_bar
,
245 'floating' : floating
,
247 'resizable' : resizable
,
248 'zoomable' : zoomable
,
250 'miniaturizable' : miniaturizable
,
251 'miniaturized' : miniaturized
,
252 'position' : position
,
254 'title_displays_device_name' : title_displays_device_name
,
255 'title_displays_shell_path' : title_displays_shell_path
,
256 'title_displays_window_size' : title_displays_window_size
,
257 'title_displays_file_name' : title_displays_file_name
,
258 'title_displays_custom_title' : title_displays_custom_title
,
259 'custom_title' : custom_title
,
260 'contents' : contents
,
262 'number_of_rows' : number_of_rows
,
263 'number_of_columns' : number_of_columns
,
264 'cursor_color' : cursor_color
,
265 'background_color' : background_color
,
266 'normal_text_color' : normal_text_color
,
267 'bold_text_color' : bold_text_color
,
273 # Indices of types declared in this module
275 _classdeclarations
= {
277 'capp' : application
,
280 _propdeclarations
= {
281 'tdfn' : title_displays_file_name
,
282 'mini' : miniaturizable
,
287 'mina' : miniaturized
,
288 'pbcl' : background_color
,
289 'tddn' : title_displays_device_name
,
291 'hclb' : has_close_box
,
295 'ptxc' : normal_text_color
,
296 'pcuc' : cursor_color
,
297 'tdsp' : title_displays_shell_path
,
299 'tdct' : title_displays_custom_title
,
301 'titl' : custom_title
,
305 'crow' : number_of_rows
,
307 'ccol' : number_of_columns
,
308 'tdws' : title_displays_window_size
,
309 'pbtc' : bold_text_color
,
310 'ptit' : has_title_bar
,
313 _compdeclarations
= {
316 _enumdeclarations
= {