1 """Suite Standard Suite: Common terms that most applications should support
4 Generated from /Volumes/Sap/System Folder/Finder
5 AETE/AEUT resource version 0/144, language 0, script 0
13 from StdSuites
.Standard_Suite
import *
14 class Standard_Suite_Events(Standard_Suite_Events
):
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
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
['----']
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
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
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
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
['----']
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
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
= {
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
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
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
= {
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)
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
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
['----']
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)
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
['----']
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
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
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
= {