append(): Fixing the test for convertability after consultation with
[python/dscho.git] / Mac / Lib / lib-scriptpackages / Finder / Standard_Suite.py
blobdf2348730b76a9095df996a1cc8491f79c7775a2
1 """Suite Standard Suite: Common terms that most applications should support
2 Level 1, version 1
4 Generated from /Volumes/Sap/System Folder/Finder
5 AETE/AEUT resource version 0/144, language 0, script 0
6 """
8 import aetools
9 import MacOS
11 _code = 'CoRe'
13 from StdSuites.Standard_Suite import *
14 class Standard_Suite_Events(Standard_Suite_Events):
16 _argmap_open = {
17 'using' : 'usin',
18 'with_properties' : 'prdt',
21 def open(self, _object, _attributes={}, **_arguments):
22 """open: Open the specified object(s)
23 Required argument: list of objects to open
24 Keyword argument using: the application file to open the object with
25 Keyword argument with_properties: the initial values for the properties, to be included with the open command sent to the application that opens the direct object
26 Keyword argument _attributes: AppleEvent attribute dictionary
27 """
28 _code = 'aevt'
29 _subcode = 'odoc'
31 aetools.keysubst(_arguments, self._argmap_open)
32 _arguments['----'] = _object
35 _reply, _arguments, _attributes = self.send(_code, _subcode,
36 _arguments, _attributes)
37 if _arguments.get('errn', 0):
38 raise aetools.Error, aetools.decodeerror(_arguments)
39 # XXXX Optionally decode result
40 if _arguments.has_key('----'):
41 return _arguments['----']
43 _argmap_print_ = {
44 'with_properties' : 'prdt',
47 def print_(self, _object, _attributes={}, **_arguments):
48 """print: Print the specified object(s)
49 Required argument: list of objects to print
50 Keyword argument with_properties: optional properties to be included with the print command sent to the application that prints the direct object
51 Keyword argument _attributes: AppleEvent attribute dictionary
52 """
53 _code = 'aevt'
54 _subcode = 'pdoc'
56 aetools.keysubst(_arguments, self._argmap_print_)
57 _arguments['----'] = _object
60 _reply, _arguments, _attributes = self.send(_code, _subcode,
61 _arguments, _attributes)
62 if _arguments.get('errn', 0):
63 raise aetools.Error, aetools.decodeerror(_arguments)
64 # XXXX Optionally decode result
65 if _arguments.has_key('----'):
66 return _arguments['----']
68 def quit(self, _no_object=None, _attributes={}, **_arguments):
69 """quit: Quit the Finder
70 Keyword argument _attributes: AppleEvent attribute dictionary
71 """
72 _code = 'aevt'
73 _subcode = 'quit'
75 if _arguments: raise TypeError, 'No optional args expected'
76 if _no_object != None: raise TypeError, 'No direct arg expected'
79 _reply, _arguments, _attributes = self.send(_code, _subcode,
80 _arguments, _attributes)
81 if _arguments.get('errn', 0):
82 raise aetools.Error, aetools.decodeerror(_arguments)
83 # XXXX Optionally decode result
84 if _arguments.has_key('----'):
85 return _arguments['----']
87 def close(self, _object, _attributes={}, **_arguments):
88 """close: Close an object
89 Required argument: the object to close
90 Keyword argument _attributes: AppleEvent attribute dictionary
91 """
92 _code = 'core'
93 _subcode = 'clos'
95 if _arguments: raise TypeError, 'No optional args expected'
96 _arguments['----'] = _object
99 _reply, _arguments, _attributes = self.send(_code, _subcode,
100 _arguments, _attributes)
101 if _arguments.get('errn', 0):
102 raise aetools.Error, aetools.decodeerror(_arguments)
103 # XXXX Optionally decode result
104 if _arguments.has_key('----'):
105 return _arguments['----']
107 _argmap_count = {
108 'each' : 'kocl',
111 def count(self, _object, _attributes={}, **_arguments):
112 """count: Return the number of elements of a particular class within an object
113 Required argument: the object whose elements are to be counted
114 Keyword argument each: the class of the elements to be counted
115 Keyword argument _attributes: AppleEvent attribute dictionary
116 Returns: the number of elements
118 _code = 'core'
119 _subcode = 'cnte'
121 aetools.keysubst(_arguments, self._argmap_count)
122 _arguments['----'] = _object
125 _reply, _arguments, _attributes = self.send(_code, _subcode,
126 _arguments, _attributes)
127 if _arguments.get('errn', 0):
128 raise aetools.Error, aetools.decodeerror(_arguments)
129 # XXXX Optionally decode result
130 if _arguments.has_key('----'):
131 return _arguments['----']
133 _argmap_data_size = {
134 'as' : 'rtyp',
137 def data_size(self, _object, _attributes={}, **_arguments):
138 """data size: Return the size in bytes of an object
139 Required argument: the object whose data size is to be returned
140 Keyword argument as: the data type for which the size is calculated
141 Keyword argument _attributes: AppleEvent attribute dictionary
142 Returns: the size of the object in bytes
144 _code = 'core'
145 _subcode = 'dsiz'
147 aetools.keysubst(_arguments, self._argmap_data_size)
148 _arguments['----'] = _object
151 _reply, _arguments, _attributes = self.send(_code, _subcode,
152 _arguments, _attributes)
153 if _arguments.get('errn', 0):
154 raise aetools.Error, aetools.decodeerror(_arguments)
155 # XXXX Optionally decode result
156 if _arguments.has_key('----'):
157 return _arguments['----']
159 def delete(self, _object, _attributes={}, **_arguments):
160 """delete: Move an item from its container to the trash
161 Required argument: the item to delete
162 Keyword argument _attributes: AppleEvent attribute dictionary
163 Returns: to the item that was just deleted
165 _code = 'core'
166 _subcode = 'delo'
168 if _arguments: raise TypeError, 'No optional args expected'
169 _arguments['----'] = _object
172 _reply, _arguments, _attributes = self.send(_code, _subcode,
173 _arguments, _attributes)
174 if _arguments.get('errn', 0):
175 raise aetools.Error, aetools.decodeerror(_arguments)
176 # XXXX Optionally decode result
177 if _arguments.has_key('----'):
178 return _arguments['----']
180 _argmap_duplicate = {
181 'to' : 'insh',
182 'replacing' : 'alrp',
183 'routing_suppressed' : 'rout',
186 def duplicate(self, _object, _attributes={}, **_arguments):
187 """duplicate: Duplicate one or more object(s)
188 Required argument: the object(s) to duplicate
189 Keyword argument to: the new location for the object(s)
190 Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being duplicated
191 Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when copying to the system folder.
192 Keyword argument _attributes: AppleEvent attribute dictionary
193 Returns: to the duplicated object(s)
195 _code = 'core'
196 _subcode = 'clon'
198 aetools.keysubst(_arguments, self._argmap_duplicate)
199 _arguments['----'] = _object
201 aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
202 aetools.enumsubst(_arguments, 'rout', _Enum_bool)
204 _reply, _arguments, _attributes = self.send(_code, _subcode,
205 _arguments, _attributes)
206 if _arguments.get('errn', 0):
207 raise aetools.Error, aetools.decodeerror(_arguments)
208 # XXXX Optionally decode result
209 if _arguments.has_key('----'):
210 return _arguments['----']
212 def exists(self, _object, _attributes={}, **_arguments):
213 """exists: Verify if an object exists
214 Required argument: the object in question
215 Keyword argument _attributes: AppleEvent attribute dictionary
216 Returns: true if it exists, false if not
218 _code = 'core'
219 _subcode = 'doex'
221 if _arguments: raise TypeError, 'No optional args expected'
222 _arguments['----'] = _object
225 _reply, _arguments, _attributes = self.send(_code, _subcode,
226 _arguments, _attributes)
227 if _arguments.get('errn', 0):
228 raise aetools.Error, aetools.decodeerror(_arguments)
229 # XXXX Optionally decode result
230 if _arguments.has_key('----'):
231 return _arguments['----']
233 _argmap_make = {
234 'new' : 'kocl',
235 'at' : 'insh',
236 'to' : 'to ',
237 'with_properties' : 'prdt',
240 def make(self, _no_object=None, _attributes={}, **_arguments):
241 """make: Make a new element
242 Keyword argument new: the class of the new element
243 Keyword argument at: the location at which to insert the element
244 Keyword argument to: when creating an alias file, the original item to create an alias to
245 Keyword argument with_properties: the initial values for the properties of the element
246 Keyword argument _attributes: AppleEvent attribute dictionary
247 Returns: to the new object(s)
249 _code = 'core'
250 _subcode = 'crel'
252 aetools.keysubst(_arguments, self._argmap_make)
253 if _no_object != None: raise TypeError, 'No direct arg expected'
256 _reply, _arguments, _attributes = self.send(_code, _subcode,
257 _arguments, _attributes)
258 if _arguments.get('errn', 0):
259 raise aetools.Error, aetools.decodeerror(_arguments)
260 # XXXX Optionally decode result
261 if _arguments.has_key('----'):
262 return _arguments['----']
264 _argmap_move = {
265 'to' : 'insh',
266 'replacing' : 'alrp',
267 'positioned_at' : 'mvpl',
268 'routing_suppressed' : 'rout',
271 def move(self, _object, _attributes={}, **_arguments):
272 """move: Move object(s) to a new location
273 Required argument: the object(s) to move
274 Keyword argument to: the new location for the object(s)
275 Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being moved
276 Keyword argument positioned_at: Gives a list (in local window coordinates) of positions for the destination items
277 Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when moving to the system folder.
278 Keyword argument _attributes: AppleEvent attribute dictionary
279 Returns: to the object(s) after they have been moved
281 _code = 'core'
282 _subcode = 'move'
284 aetools.keysubst(_arguments, self._argmap_move)
285 _arguments['----'] = _object
287 aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
288 aetools.enumsubst(_arguments, 'mvpl', _Enum_list)
289 aetools.enumsubst(_arguments, 'rout', _Enum_bool)
291 _reply, _arguments, _attributes = self.send(_code, _subcode,
292 _arguments, _attributes)
293 if _arguments.get('errn', 0):
294 raise aetools.Error, aetools.decodeerror(_arguments)
295 # XXXX Optionally decode result
296 if _arguments.has_key('----'):
297 return _arguments['----']
299 def select(self, _object, _attributes={}, **_arguments):
300 """select: Select the specified object(s)
301 Required argument: the object to select
302 Keyword argument _attributes: AppleEvent attribute dictionary
304 _code = 'misc'
305 _subcode = 'slct'
307 if _arguments: raise TypeError, 'No optional args expected'
308 _arguments['----'] = _object
311 _reply, _arguments, _attributes = self.send(_code, _subcode,
312 _arguments, _attributes)
313 if _arguments.get('errn', 0):
314 raise aetools.Error, aetools.decodeerror(_arguments)
315 # XXXX Optionally decode result
316 if _arguments.has_key('----'):
317 return _arguments['----']
319 _Enum_list = None # XXXX enum list not found!!
320 _Enum_bool = None # XXXX enum bool not found!!
323 # Indices of types declared in this module
325 _classdeclarations = {
328 _propdeclarations = {
331 _compdeclarations = {
334 _enumdeclarations = {