1 """Suite Terminal Suite: Terms and Events for controlling the Terminal application 2 Level 1, version 1 3 4 Generated from /Applications/Utilities/Terminal.app 5 AETE/AEUT resource version 1/0, language 0, script 0 6 """ 7 8 import aetools 9 import MacOS 10 11 _code = 'trmx' 12 13 class Terminal_Suite_Events: 14 15 def GetURL(self, _object, _attributes={}, **_arguments): 16 """GetURL: Opens a telnet: URL 17 Required argument: the object for the command 18 Keyword argument _attributes: AppleEvent attribute dictionary 19 """ 20 _code = 'GURL' 21 _subcode = 'GURL' 22 23 if _arguments: raise TypeError, 'No optional args expected' 24 _arguments['----'] = _object 25 26 27 _reply, _arguments, _attributes = self.send(_code, _subcode, 28 _arguments, _attributes) 29 if _arguments.get('errn', 0): 30 raise aetools.Error, aetools.decodeerror(_arguments) 31 # XXXX Optionally decode result 32 if _arguments.has_key('----'): 33 return _arguments['----'] 34 35 _argmap_do_script = { 36 'in_' : 'kfil', 37 'with_command' : 'cmnd', 38 } 39 40 def do_script(self, _object, _attributes={}, **_arguments): 41 """do script: Run a UNIX shell script or command 42 Required argument: the object for the command 43 Keyword argument in_: the window in which to execute the command 44 Keyword argument with_command: data to be passed to the Terminal application as the command line, deprecated, use direct parameter 45 Keyword argument _attributes: AppleEvent attribute dictionary 46 Returns: the reply for the command 47 """ 48 _code = 'core' 49 _subcode = 'dosc' 50 51 aetools.keysubst(_arguments, self._argmap_do_script) 52 _arguments['----'] = _object 53 54 55 _reply, _arguments, _attributes = self.send(_code, _subcode, 56 _arguments, _attributes) 57 if _arguments.get('errn', 0): 58 raise aetools.Error, aetools.decodeerror(_arguments) 59 # XXXX Optionally decode result 60 if _arguments.has_key('----'): 61 return _arguments['----'] 62 63 64 class application(aetools.ComponentItem): 65 """application - The Terminal program """ 66 want = 'capp' 67 class _Prop__3c_Inheritance_3e_(aetools.NProperty): 68 """<Inheritance> - All of the properties of the superclass. """ 69 which = 'c@#^' 70 want = 'capp' 71 _3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() 72 class _Prop_properties(aetools.NProperty): 73 """properties - every property of the Terminal program """ 74 which = 'pALL' 75 want = '****' 76 properties = _Prop_properties() 77 # element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] 78 # element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] 79 80 applications = application 81 82 class window(aetools.ComponentItem): 83 """window - A Terminal window """ 84 want = 'cwin' 85 class _Prop_background_color(aetools.NProperty): 86 """background color - the background color for the window """ 87 which = 'pbcl' 88 want = '****' 89 class _Prop_bold_text_color(aetools.NProperty): 90 """bold text color - the bold text color for the window """ 91 which = 'pbtc' 92 want = '****' 93 class _Prop_bounds(aetools.NProperty): 94 """bounds - the boundary rectangle for the window, relative to the upper left corner of the screen """ 95 which = 'pbnd' 96 want = '****' 97 class _Prop_busy(aetools.NProperty): 98 """busy - Is the window busy running a process? """ 99 which = 'busy' 100 want = 'bool' 101 class _Prop_contents(aetools.NProperty): 102 """contents - the currently visible contents of the window """ 103 which = 'pcnt' 104 want = 'utxt' 105 class _Prop_cursor_color(aetools.NProperty): 106 """cursor color - the cursor color for the window """ 107 which = 'pcuc' 108 want = '****' 109 class _Prop_custom_title(aetools.NProperty): 110 """custom title - the custom title for the window """ 111 which = 'titl' 112 want = 'utxt' 113 class _Prop_frame(aetools.NProperty): 114 """frame - the origin and size of the window """ 115 which = 'pfra' 116 want = '****' 117 class _Prop_frontmost(aetools.NProperty): 118 """frontmost - Is the window in front of the other Terminal windows? """ 119 which = 'pisf' 120 want = 'bool' 121 class _Prop_history(aetools.NProperty): 122 """history - the contents of the entire scrolling buffer of the window """ 123 which = 'hist' 124 want = 'utxt' 125 class _Prop_normal_text_color(aetools.NProperty): 126 """normal text color - the normal text color for the window """ 127 which = 'ptxc' 128 want = '****' 129 class _Prop_number_of_columns(aetools.NProperty): 130 """number of columns - the number of columns in the window """ 131 which = 'ccol' 132 want = 'long' 133 class _Prop_number_of_rows(aetools.NProperty): 134 """number of rows - the number of rows in the window """ 135 which = 'crow' 136 want = 'long' 137 class _Prop_origin(aetools.NProperty): 138 """origin - the lower left coordinates of the window, relative to the lower left corner of the screen """ 139 which = 'pori' 140 want = '****' 141 class _Prop_position(aetools.NProperty): 142 """position - the upper left coordinates of the window, relative to the upper left corner of the screen """ 143 which = 'ppos' 144 want = '****' 145 class _Prop_processes(aetools.NProperty): 146 """processes - a list of the currently running processes """ 147 which = 'prcs' 148 want = 'utxt' 149 class _Prop_size(aetools.NProperty): 150 """size - the width and height of the window """ 151 which = 'psiz' 152 want = '****' 153 class _Prop_title_displays_custom_title(aetools.NProperty): 154 """title displays custom title - Does the title for the window contain a custom title? """ 155 which = 'tdct' 156 want = 'bool' 157 class _Prop_title_displays_device_name(aetools.NProperty): 158 """title displays device name - Does the title for the window contain the device name? """ 159 which = 'tddn' 160 want = 'bool' 161 class _Prop_title_displays_file_name(aetools.NProperty): 162 """title displays file name - Does the title for the window contain the file name? """ 163 which = 'tdfn' 164 want = 'bool' 165 class _Prop_title_displays_shell_path(aetools.NProperty): 166 """title displays shell path - Does the title for the window contain the shell path? """ 167 which = 'tdsp' 168 want = 'bool' 169 class _Prop_title_displays_window_size(aetools.NProperty): 170 """title displays window size - Does the title for the window contain the window size? """ 171 which = 'tdws' 172 want = 'bool' 173 174 windows = window 175 application._superclassnames = [] 176 import Standard_Suite 177 application._privpropdict = { 178 '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, 179 'properties' : _Prop_properties, 180 } 181 application._privelemdict = { 182 'document' : Standard_Suite.document, 183 'window' : window, 184 } 185 window._superclassnames = [] 186 window._privpropdict = { 187 '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, 188 'background_color' : _Prop_background_color, 189 'bold_text_color' : _Prop_bold_text_color, 190 'bounds' : _Prop_bounds, 191 'busy' : _Prop_busy, 192 'contents' : _Prop_contents, 193 'cursor_color' : _Prop_cursor_color, 194 'custom_title' : _Prop_custom_title, 195 'frame' : _Prop_frame, 196 'frontmost' : _Prop_frontmost, 197 'history' : _Prop_history, 198 'normal_text_color' : _Prop_normal_text_color, 199 'number_of_columns' : _Prop_number_of_columns, 200 'number_of_rows' : _Prop_number_of_rows, 201 'origin' : _Prop_origin, 202 'position' : _Prop_position, 203 'processes' : _Prop_processes, 204 'properties' : _Prop_properties, 205 'size' : _Prop_size, 206 'title_displays_custom_title' : _Prop_title_displays_custom_title, 207 'title_displays_device_name' : _Prop_title_displays_device_name, 208 'title_displays_file_name' : _Prop_title_displays_file_name, 209 'title_displays_shell_path' : _Prop_title_displays_shell_path, 210 'title_displays_window_size' : _Prop_title_displays_window_size, 211 } 212 window._privelemdict = { 213 } 214 215 # 216 # Indices of types declared in this module 217 # 218 _classdeclarations = { 219 'capp' : application, 220 'cwin' : window, 221 } 222 223 _propdeclarations = { 224 'busy' : _Prop_busy, 225 'c@#^' : _Prop__3c_Inheritance_3e_, 226 'ccol' : _Prop_number_of_columns, 227 'crow' : _Prop_number_of_rows, 228 'hist' : _Prop_history, 229 'pALL' : _Prop_properties, 230 'pbcl' : _Prop_background_color, 231 'pbnd' : _Prop_bounds, 232 'pbtc' : _Prop_bold_text_color, 233 'pcnt' : _Prop_contents, 234 'pcuc' : _Prop_cursor_color, 235 'pfra' : _Prop_frame, 236 'pisf' : _Prop_frontmost, 237 'pori' : _Prop_origin, 238 'ppos' : _Prop_position, 239 'prcs' : _Prop_processes, 240 'psiz' : _Prop_size, 241 'ptxc' : _Prop_normal_text_color, 242 'tdct' : _Prop_title_displays_custom_title, 243 'tddn' : _Prop_title_displays_device_name, 244 'tdfn' : _Prop_title_displays_file_name, 245 'tdsp' : _Prop_title_displays_shell_path, 246 'tdws' : _Prop_title_displays_window_size, 247 'titl' : _Prop_custom_title, 248 } 249 250 _compdeclarations = { 251 } 252 253 _enumdeclarations = { 254 } 255