|
1 """Suite Finder items: Commands used with file system items, and basic item definition |
|
2 Level 1, version 1 |
|
3 |
|
4 Generated from /System/Library/CoreServices/Finder.app |
|
5 AETE/AEUT resource version 0/144, language 0, script 0 |
|
6 """ |
|
7 |
|
8 import aetools |
|
9 import MacOS |
|
10 |
|
11 _code = 'fndr' |
|
12 |
|
13 class Finder_items_Events: |
|
14 |
|
15 def add_to_favorites(self, _object, _attributes={}, **_arguments): |
|
16 """add to favorites: (NOT AVAILABLE YET) Add the items to the user\xd5s Favorites |
|
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' |
|
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_clean_up = { |
|
36 'by' : 'by ', |
|
37 } |
|
38 |
|
39 def clean_up(self, _object, _attributes={}, **_arguments): |
|
40 """clean up: (NOT AVAILABLE YET) Arrange items in window nicely (only applies to open windows in icon view 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' |
|
47 |
|
48 aetools.keysubst(_arguments, self._argmap_clean_up) |
|
49 _arguments['----'] = _object |
|
50 |
|
51 |
|
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['----'] |
|
59 |
|
60 def eject(self, _object=None, _attributes={}, **_arguments): |
|
61 """eject: Eject the specified disk(s) |
|
62 Required argument: the disk(s) to eject |
|
63 Keyword argument _attributes: AppleEvent attribute dictionary |
|
64 """ |
|
65 _code = 'fndr' |
|
66 _subcode = 'ejct' |
|
67 |
|
68 if _arguments: raise TypeError, 'No optional args expected' |
|
69 _arguments['----'] = _object |
|
70 |
|
71 |
|
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['----'] |
|
79 |
|
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' |
|
87 |
|
88 if _arguments: raise TypeError, 'No optional args expected' |
|
89 _arguments['----'] = _object |
|
90 |
|
91 |
|
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['----'] |
|
99 |
|
100 def erase(self, _object, _attributes={}, **_arguments): |
|
101 """erase: (NOT AVAILABLE) Erase the specified disk(s) |
|
102 Required argument: the items to erase |
|
103 Keyword argument _attributes: AppleEvent attribute dictionary |
|
104 """ |
|
105 _code = 'fndr' |
|
106 _subcode = 'fera' |
|
107 |
|
108 if _arguments: raise TypeError, 'No optional args expected' |
|
109 _arguments['----'] = _object |
|
110 |
|
111 |
|
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['----'] |
|
119 |
|
120 def reveal(self, _object, _attributes={}, **_arguments): |
|
121 """reveal: Bring the specified object(s) into view |
|
122 Required argument: the object to be made visible |
|
123 Keyword argument _attributes: AppleEvent attribute dictionary |
|
124 """ |
|
125 _code = 'misc' |
|
126 _subcode = 'mvis' |
|
127 |
|
128 if _arguments: raise TypeError, 'No optional args expected' |
|
129 _arguments['----'] = _object |
|
130 |
|
131 |
|
132 _reply, _arguments, _attributes = self.send(_code, _subcode, |
|
133 _arguments, _attributes) |
|
134 if _arguments.get('errn', 0): |
|
135 raise aetools.Error, aetools.decodeerror(_arguments) |
|
136 # XXXX Optionally decode result |
|
137 if _arguments.has_key('----'): |
|
138 return _arguments['----'] |
|
139 |
|
140 _argmap_update = { |
|
141 'necessity' : 'nec?', |
|
142 'registering_applications' : 'reg?', |
|
143 } |
|
144 |
|
145 def update(self, _object, _attributes={}, **_arguments): |
|
146 """update: Update the display of the specified object(s) to match their on-disk representation |
|
147 Required argument: the item to update |
|
148 Keyword argument necessity: only update if necessary (i.e. a finder window is open). default is false |
|
149 Keyword argument registering_applications: register applications. default is true |
|
150 Keyword argument _attributes: AppleEvent attribute dictionary |
|
151 """ |
|
152 _code = 'fndr' |
|
153 _subcode = 'fupd' |
|
154 |
|
155 aetools.keysubst(_arguments, self._argmap_update) |
|
156 _arguments['----'] = _object |
|
157 |
|
158 |
|
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['----'] |
|
166 |
|
167 |
|
168 class item(aetools.ComponentItem): |
|
169 """item - An item """ |
|
170 want = 'cobj' |
|
171 class _Prop_bounds(aetools.NProperty): |
|
172 """bounds - the bounding rectangle of the item (can only be set for an item in a window viewed as icons or buttons) """ |
|
173 which = 'pbnd' |
|
174 want = 'qdrt' |
|
175 class _Prop_comment(aetools.NProperty): |
|
176 """comment - the comment of the item, displayed in the \xd2Get Info\xd3 window """ |
|
177 which = 'comt' |
|
178 want = 'utxt' |
|
179 class _Prop_container(aetools.NProperty): |
|
180 """container - the container of the item """ |
|
181 which = 'ctnr' |
|
182 want = 'obj ' |
|
183 class _Prop_creation_date(aetools.NProperty): |
|
184 """creation date - the date on which the item was created """ |
|
185 which = 'ascd' |
|
186 want = 'ldt ' |
|
187 class _Prop_description(aetools.NProperty): |
|
188 """description - a description of the item """ |
|
189 which = 'dscr' |
|
190 want = 'utxt' |
|
191 class _Prop_disk(aetools.NProperty): |
|
192 """disk - the disk on which the item is stored """ |
|
193 which = 'cdis' |
|
194 want = 'obj ' |
|
195 class _Prop_displayed_name(aetools.NProperty): |
|
196 """displayed name - the user-visible name of the item """ |
|
197 which = 'dnam' |
|
198 want = 'utxt' |
|
199 class _Prop_everyones_privileges(aetools.NProperty): |
|
200 """everyones privileges - """ |
|
201 which = 'gstp' |
|
202 want = 'priv' |
|
203 class _Prop_extension_hidden(aetools.NProperty): |
|
204 """extension hidden - Is the item's extension hidden from the user? """ |
|
205 which = 'hidx' |
|
206 want = 'bool' |
|
207 class _Prop_group(aetools.NProperty): |
|
208 """group - the user or group that has special access to the container """ |
|
209 which = 'sgrp' |
|
210 want = 'utxt' |
|
211 class _Prop_group_privileges(aetools.NProperty): |
|
212 """group privileges - """ |
|
213 which = 'gppr' |
|
214 want = 'priv' |
|
215 class _Prop_icon(aetools.NProperty): |
|
216 """icon - the icon bitmap of the item """ |
|
217 which = 'iimg' |
|
218 want = 'ifam' |
|
219 class _Prop_index(aetools.NProperty): |
|
220 """index - the index in the front-to-back ordering within its container """ |
|
221 which = 'pidx' |
|
222 want = 'long' |
|
223 class _Prop_information_window(aetools.NProperty): |
|
224 """information window - the information window for the item """ |
|
225 which = 'iwnd' |
|
226 want = 'obj ' |
|
227 class _Prop_kind(aetools.NProperty): |
|
228 """kind - the kind of the item """ |
|
229 which = 'kind' |
|
230 want = 'utxt' |
|
231 class _Prop_label_index(aetools.NProperty): |
|
232 """label index - the label of the item """ |
|
233 which = 'labi' |
|
234 want = 'long' |
|
235 class _Prop_locked(aetools.NProperty): |
|
236 """locked - Is the file locked? """ |
|
237 which = 'aslk' |
|
238 want = 'bool' |
|
239 class _Prop_modification_date(aetools.NProperty): |
|
240 """modification date - the date on which the item was last modified """ |
|
241 which = 'asmo' |
|
242 want = 'ldt ' |
|
243 class _Prop_name(aetools.NProperty): |
|
244 """name - the name of the item """ |
|
245 which = 'pnam' |
|
246 want = 'utxt' |
|
247 class _Prop_name_extension(aetools.NProperty): |
|
248 """name extension - the name extension of the item (such as \xd2txt\xd3) """ |
|
249 which = 'nmxt' |
|
250 want = 'utxt' |
|
251 class _Prop_owner(aetools.NProperty): |
|
252 """owner - the user that owns the container """ |
|
253 which = 'sown' |
|
254 want = 'utxt' |
|
255 class _Prop_owner_privileges(aetools.NProperty): |
|
256 """owner privileges - """ |
|
257 which = 'ownr' |
|
258 want = 'priv' |
|
259 class _Prop_physical_size(aetools.NProperty): |
|
260 """physical size - the actual space used by the item on disk """ |
|
261 which = 'phys' |
|
262 want = 'comp' |
|
263 class _Prop_position(aetools.NProperty): |
|
264 """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) """ |
|
265 which = 'posn' |
|
266 want = 'QDpt' |
|
267 class _Prop_properties(aetools.NProperty): |
|
268 """properties - every property of an item """ |
|
269 which = 'pALL' |
|
270 want = 'reco' |
|
271 class _Prop_size(aetools.NProperty): |
|
272 """size - the logical size of the item """ |
|
273 which = 'ptsz' |
|
274 want = 'comp' |
|
275 class _Prop_url(aetools.NProperty): |
|
276 """url - the url of the item """ |
|
277 which = 'pURL' |
|
278 want = 'utxt' |
|
279 |
|
280 items = item |
|
281 item._superclassnames = [] |
|
282 item._privpropdict = { |
|
283 'bounds' : _Prop_bounds, |
|
284 'comment' : _Prop_comment, |
|
285 'container' : _Prop_container, |
|
286 'creation_date' : _Prop_creation_date, |
|
287 'description' : _Prop_description, |
|
288 'disk' : _Prop_disk, |
|
289 'displayed_name' : _Prop_displayed_name, |
|
290 'everyones_privileges' : _Prop_everyones_privileges, |
|
291 'extension_hidden' : _Prop_extension_hidden, |
|
292 'group' : _Prop_group, |
|
293 'group_privileges' : _Prop_group_privileges, |
|
294 'icon' : _Prop_icon, |
|
295 'index' : _Prop_index, |
|
296 'information_window' : _Prop_information_window, |
|
297 'kind' : _Prop_kind, |
|
298 'label_index' : _Prop_label_index, |
|
299 'locked' : _Prop_locked, |
|
300 'modification_date' : _Prop_modification_date, |
|
301 'name' : _Prop_name, |
|
302 'name_extension' : _Prop_name_extension, |
|
303 'owner' : _Prop_owner, |
|
304 'owner_privileges' : _Prop_owner_privileges, |
|
305 'physical_size' : _Prop_physical_size, |
|
306 'position' : _Prop_position, |
|
307 'properties' : _Prop_properties, |
|
308 'size' : _Prop_size, |
|
309 'url' : _Prop_url, |
|
310 } |
|
311 item._privelemdict = { |
|
312 } |
|
313 |
|
314 # |
|
315 # Indices of types declared in this module |
|
316 # |
|
317 _classdeclarations = { |
|
318 'cobj' : item, |
|
319 } |
|
320 |
|
321 _propdeclarations = { |
|
322 'ascd' : _Prop_creation_date, |
|
323 'aslk' : _Prop_locked, |
|
324 'asmo' : _Prop_modification_date, |
|
325 'cdis' : _Prop_disk, |
|
326 'comt' : _Prop_comment, |
|
327 'ctnr' : _Prop_container, |
|
328 'dnam' : _Prop_displayed_name, |
|
329 'dscr' : _Prop_description, |
|
330 'gppr' : _Prop_group_privileges, |
|
331 'gstp' : _Prop_everyones_privileges, |
|
332 'hidx' : _Prop_extension_hidden, |
|
333 'iimg' : _Prop_icon, |
|
334 'iwnd' : _Prop_information_window, |
|
335 'kind' : _Prop_kind, |
|
336 'labi' : _Prop_label_index, |
|
337 'nmxt' : _Prop_name_extension, |
|
338 'ownr' : _Prop_owner_privileges, |
|
339 'pALL' : _Prop_properties, |
|
340 'pURL' : _Prop_url, |
|
341 'pbnd' : _Prop_bounds, |
|
342 'phys' : _Prop_physical_size, |
|
343 'pidx' : _Prop_index, |
|
344 'pnam' : _Prop_name, |
|
345 'posn' : _Prop_position, |
|
346 'ptsz' : _Prop_size, |
|
347 'sgrp' : _Prop_group, |
|
348 'sown' : _Prop_owner, |
|
349 } |
|
350 |
|
351 _compdeclarations = { |
|
352 } |
|
353 |
|
354 _enumdeclarations = { |
|
355 } |