append(): Fixing the test for convertability after consultation with
[python/dscho.git] / Mac / Lib / lib-scriptpackages / Finder / Finder_items.py
blob1475fa6afc4910f83663e49bde1764422ccd53d3
1 """Suite Finder items: Commands used with file system items, and basic item definition
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 = 'fndr'
13 class Finder_items_Events:
15 def add_to_favorites(self, _object, _attributes={}, **_arguments):
16 """add to favorites: Add the items to the Favorites menu in the Apple Menu and in Open and Save dialogs
17 Required argument: the items to add to the collection of Favorites
18 Keyword argument _attributes: AppleEvent attribute dictionary
19 """
20 _code = 'fndr'
21 _subcode = 'ffav'
23 if _arguments: raise TypeError, 'No optional args expected'
24 _arguments['----'] = _object
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['----']
35 _argmap_clean_up = {
36 'by' : 'by ',
39 def clean_up(self, _object, _attributes={}, **_arguments):
40 """clean up: Arrange items in window nicely (only applies to open windows in icon or button views that are not kept arranged)
41 Required argument: the window to clean up
42 Keyword argument by: the order in which to clean up the objects (name, index, date, etc.)
43 Keyword argument _attributes: AppleEvent attribute dictionary
44 """
45 _code = 'fndr'
46 _subcode = 'fclu'
48 aetools.keysubst(_arguments, self._argmap_clean_up)
49 _arguments['----'] = _object
52 _reply, _arguments, _attributes = self.send(_code, _subcode,
53 _arguments, _attributes)
54 if _arguments.get('errn', 0):
55 raise aetools.Error, aetools.decodeerror(_arguments)
56 # XXXX Optionally decode result
57 if _arguments.has_key('----'):
58 return _arguments['----']
60 def eject(self, _object=None, _attributes={}, **_arguments):
61 """eject: Eject the specified disk(s), or every ejectable disk if no parameter is specified
62 Required argument: the items to eject
63 Keyword argument _attributes: AppleEvent attribute dictionary
64 """
65 _code = 'fndr'
66 _subcode = 'ejct'
68 if _arguments: raise TypeError, 'No optional args expected'
69 _arguments['----'] = _object
72 _reply, _arguments, _attributes = self.send(_code, _subcode,
73 _arguments, _attributes)
74 if _arguments.get('errn', 0):
75 raise aetools.Error, aetools.decodeerror(_arguments)
76 # XXXX Optionally decode result
77 if _arguments.has_key('----'):
78 return _arguments['----']
80 def empty(self, _object=None, _attributes={}, **_arguments):
81 """empty: Empty the trash
82 Required argument: \xd2empty\xd3 and \xd2empty trash\xd3 both do the same thing
83 Keyword argument _attributes: AppleEvent attribute dictionary
84 """
85 _code = 'fndr'
86 _subcode = 'empt'
88 if _arguments: raise TypeError, 'No optional args expected'
89 _arguments['----'] = _object
92 _reply, _arguments, _attributes = self.send(_code, _subcode,
93 _arguments, _attributes)
94 if _arguments.get('errn', 0):
95 raise aetools.Error, aetools.decodeerror(_arguments)
96 # XXXX Optionally decode result
97 if _arguments.has_key('----'):
98 return _arguments['----']
100 def erase(self, _object, _attributes={}, **_arguments):
101 """erase: Erase the specified disk(s)
102 Required argument: the items to erase
103 Keyword argument _attributes: AppleEvent attribute dictionary
105 _code = 'fndr'
106 _subcode = 'fera'
108 if _arguments: raise TypeError, 'No optional args expected'
109 _arguments['----'] = _object
112 _reply, _arguments, _attributes = self.send(_code, _subcode,
113 _arguments, _attributes)
114 if _arguments.get('errn', 0):
115 raise aetools.Error, aetools.decodeerror(_arguments)
116 # XXXX Optionally decode result
117 if _arguments.has_key('----'):
118 return _arguments['----']
120 _argmap_put_away = {
121 'asking' : 'fask',
124 def put_away(self, _object, _attributes={}, **_arguments):
125 """put away: Put away the specified object(s)
126 Required argument: the items to put away
127 Keyword argument asking: Specifies whether or not to present a dialog to confirm putting this item away.
128 Keyword argument _attributes: AppleEvent attribute dictionary
129 Returns: the object put away in its put-away location
131 _code = 'fndr'
132 _subcode = 'ptwy'
134 aetools.keysubst(_arguments, self._argmap_put_away)
135 _arguments['----'] = _object
137 aetools.enumsubst(_arguments, 'fask', _Enum_bool)
139 _reply, _arguments, _attributes = self.send(_code, _subcode,
140 _arguments, _attributes)
141 if _arguments.get('errn', 0):
142 raise aetools.Error, aetools.decodeerror(_arguments)
143 # XXXX Optionally decode result
144 if _arguments.has_key('----'):
145 return _arguments['----']
147 def reveal(self, _object, _attributes={}, **_arguments):
148 """reveal: Bring the specified object(s) into view
149 Required argument: the object to be made visible
150 Keyword argument _attributes: AppleEvent attribute dictionary
152 _code = 'misc'
153 _subcode = 'mvis'
155 if _arguments: raise TypeError, 'No optional args expected'
156 _arguments['----'] = _object
159 _reply, _arguments, _attributes = self.send(_code, _subcode,
160 _arguments, _attributes)
161 if _arguments.get('errn', 0):
162 raise aetools.Error, aetools.decodeerror(_arguments)
163 # XXXX Optionally decode result
164 if _arguments.has_key('----'):
165 return _arguments['----']
167 def update(self, _object, _attributes={}, **_arguments):
168 """update: Update the display of the specified object(s) to match their on-disk representation
169 Required argument: the item to update
170 Keyword argument _attributes: AppleEvent attribute dictionary
172 _code = 'fndr'
173 _subcode = 'fupd'
175 if _arguments: raise TypeError, 'No optional args expected'
176 _arguments['----'] = _object
179 _reply, _arguments, _attributes = self.send(_code, _subcode,
180 _arguments, _attributes)
181 if _arguments.get('errn', 0):
182 raise aetools.Error, aetools.decodeerror(_arguments)
183 # XXXX Optionally decode result
184 if _arguments.has_key('----'):
185 return _arguments['----']
188 class item(aetools.ComponentItem):
189 """item - An item """
190 want = 'cobj'
191 class name(aetools.NProperty):
192 """name - the name of the item """
193 which = 'pnam'
194 want = 'itxt'
195 class index(aetools.NProperty):
196 """index - the index in the front-to-back ordering within its container """
197 which = 'pidx'
198 want = 'long'
199 class id(aetools.NProperty):
200 """id - an id that identifies the item """
201 which = 'ID '
202 want = 'long'
203 class container(aetools.NProperty):
204 """container - the container of the item """
205 which = 'ctnr'
206 want = 'obj '
207 class disk(aetools.NProperty):
208 """disk - the disk on which the item is stored """
209 which = 'cdis'
210 want = 'obj '
211 class folder(aetools.NProperty):
212 """folder - the folder in which the item is stored """
213 which = 'asdr'
214 want = 'obj '
215 class position(aetools.NProperty):
216 """position - the position of the item within its parent window (can only be set for an item in a window viewed as icons or buttons) """
217 which = 'posn'
218 want = 'QDpt'
219 class bounds(aetools.NProperty):
220 """bounds - the bounding rectangle of the item (can only be set for an item in a window viewed as icons or buttons) """
221 which = 'pbnd'
222 want = 'qdrt'
223 class label_index(aetools.NProperty):
224 """label index - the label of the item """
225 which = 'labi'
226 want = 'long'
227 class kind(aetools.NProperty):
228 """kind - the kind of the item """
229 which = 'kind'
230 want = 'itxt'
231 class description(aetools.NProperty):
232 """description - a description of the item """
233 which = 'dscr'
234 want = 'itxt'
235 class comment(aetools.NProperty):
236 """comment - the comment of the item, displayed in the \xd2Get Info\xd3 window """
237 which = 'comt'
238 want = 'itxt'
239 class size(aetools.NProperty):
240 """size - the logical size of the item """
241 which = 'ptsz'
242 want = 'long'
243 class physical_size(aetools.NProperty):
244 """physical size - the actual space used by the item on disk """
245 which = 'phys'
246 want = 'long'
247 class creation_date(aetools.NProperty):
248 """creation date - the date on which the item was created """
249 which = 'ascd'
250 want = 'ldt '
251 class modification_date(aetools.NProperty):
252 """modification date - the date on which the item was last modified """
253 which = 'asmo'
254 want = 'ldt '
255 class icon(aetools.NProperty):
256 """icon - the icon bitmap of the item """
257 which = 'iimg'
258 want = 'ifam'
259 class selected(aetools.NProperty):
260 """selected - Is the item selected? """
261 which = 'issl'
262 want = 'bool'
263 class content_space(aetools.NProperty):
264 """content space - the window that would open if the item was opened """
265 which = 'dwnd'
266 want = 'obj '
267 class window(aetools.NProperty):
268 """window - the window that would open if the item was opened """
269 which = 'cwin'
270 want = 'obj '
271 class information_window(aetools.NProperty):
272 """information window - the information window for the item """
273 which = 'iwnd'
274 want = 'obj '
276 items = item
277 item._superclassnames = []
278 item._privpropdict = {
279 'name' : name,
280 'index' : index,
281 'id' : id,
282 'container' : container,
283 'disk' : disk,
284 'folder' : folder,
285 'position' : position,
286 'bounds' : bounds,
287 'label_index' : label_index,
288 'kind' : kind,
289 'description' : description,
290 'comment' : comment,
291 'size' : size,
292 'physical_size' : physical_size,
293 'creation_date' : creation_date,
294 'modification_date' : modification_date,
295 'icon' : icon,
296 'selected' : selected,
297 'content_space' : content_space,
298 'window' : window,
299 'information_window' : information_window,
301 item._privelemdict = {
303 _Enum_bool = None # XXXX enum bool not found!!
306 # Indices of types declared in this module
308 _classdeclarations = {
309 'cobj' : item,
312 _propdeclarations = {
313 'posn' : position,
314 'kind' : kind,
315 'ptsz' : size,
316 'phys' : physical_size,
317 'dwnd' : content_space,
318 'pbnd' : bounds,
319 'issl' : selected,
320 'labi' : label_index,
321 'dscr' : description,
322 'comt' : comment,
323 'ctnr' : container,
324 'pidx' : index,
325 'iimg' : icon,
326 'ID ' : id,
327 'cwin' : window,
328 'pnam' : name,
329 'ascd' : creation_date,
330 'cdis' : disk,
331 'asmo' : modification_date,
332 'asdr' : folder,
333 'iwnd' : information_window,
336 _compdeclarations = {
339 _enumdeclarations = {