Bump version to 1.0.
[python/dscho.git] / Mac / Lib / lib-scriptpackages / Finder / Finder_items.py
blobcc87f7ffb5099b248a2ed97e5a99e324680cebc3
1 """Suite Finder items: Commands used with file system items, and basic item definition
2 Level 1, version 1
4 Generated from Macintosh HD:Systeemmap: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.has_key('errn'):
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.has_key('errn'):
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.has_key('errn'):
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: ³empty² and ³empty trash² 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.has_key('errn'):
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.has_key('errn'):
115 raise aetools.Error, aetools.decodeerror(_arguments)
116 # XXXX Optionally decode result
117 if _arguments.has_key('----'):
118 return _arguments['----']
120 def put_away(self, _object, _attributes={}, **_arguments):
121 """put away: Put away the specified object(s)
122 Required argument: the items to put away
123 Keyword argument _attributes: AppleEvent attribute dictionary
124 Returns: the object put away in its put-away location
126 _code = 'fndr'
127 _subcode = 'ptwy'
129 if _arguments: raise TypeError, 'No optional args expected'
130 _arguments['----'] = _object
133 _reply, _arguments, _attributes = self.send(_code, _subcode,
134 _arguments, _attributes)
135 if _arguments.has_key('errn'):
136 raise aetools.Error, aetools.decodeerror(_arguments)
137 # XXXX Optionally decode result
138 if _arguments.has_key('----'):
139 return _arguments['----']
141 def reveal(self, _object, _attributes={}, **_arguments):
142 """reveal: Bring the specified object(s) into view
143 Required argument: the object to be made visible
144 Keyword argument _attributes: AppleEvent attribute dictionary
146 _code = 'misc'
147 _subcode = 'mvis'
149 if _arguments: raise TypeError, 'No optional args expected'
150 _arguments['----'] = _object
153 _reply, _arguments, _attributes = self.send(_code, _subcode,
154 _arguments, _attributes)
155 if _arguments.has_key('errn'):
156 raise aetools.Error, aetools.decodeerror(_arguments)
157 # XXXX Optionally decode result
158 if _arguments.has_key('----'):
159 return _arguments['----']
161 def update(self, _object, _attributes={}, **_arguments):
162 """update: Update the display of the specified object(s) to match their on-disk representation
163 Required argument: the item to update
164 Keyword argument _attributes: AppleEvent attribute dictionary
166 _code = 'fndr'
167 _subcode = 'fupd'
169 if _arguments: raise TypeError, 'No optional args expected'
170 _arguments['----'] = _object
173 _reply, _arguments, _attributes = self.send(_code, _subcode,
174 _arguments, _attributes)
175 if _arguments.has_key('errn'):
176 raise aetools.Error, aetools.decodeerror(_arguments)
177 # XXXX Optionally decode result
178 if _arguments.has_key('----'):
179 return _arguments['----']
182 class item(aetools.ComponentItem):
183 """item - An item """
184 want = 'cobj'
185 class name(aetools.NProperty):
186 """name - the name of the item """
187 which = 'pnam'
188 want = 'itxt'
189 class index(aetools.NProperty):
190 """index - the index in the front-to-back ordering within its container """
191 which = 'pidx'
192 want = 'long'
193 class id(aetools.NProperty):
194 """id - an id that identifies the item """
195 which = 'ID '
196 want = 'long'
197 class container(aetools.NProperty):
198 """container - the container of the item """
199 which = 'ctnr'
200 want = 'obj '
201 class disk(aetools.NProperty):
202 """disk - the disk on which the item is stored """
203 which = 'cdis'
204 want = 'obj '
205 class folder(aetools.NProperty):
206 """folder - the folder in which the item is stored """
207 which = 'asdr'
208 want = 'obj '
209 class position(aetools.NProperty):
210 """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) """
211 which = 'posn'
212 want = 'QDpt'
213 class bounds(aetools.NProperty):
214 """bounds - the bounding rectangle of the item (can only be set for an item in a window viewed as icons or buttons) """
215 which = 'pbnd'
216 want = 'qdrt'
217 class label_index(aetools.NProperty):
218 """label index - the label of the item """
219 which = 'labi'
220 want = 'long'
221 class kind(aetools.NProperty):
222 """kind - the kind of the item """
223 which = 'kind'
224 want = 'itxt'
225 class description(aetools.NProperty):
226 """description - a description of the item """
227 which = 'dscr'
228 want = 'itxt'
229 class comment(aetools.NProperty):
230 """comment - the comment of the item, displayed in the ³Get Info² window """
231 which = 'comt'
232 want = 'itxt'
233 class size(aetools.NProperty):
234 """size - the logical size of the item """
235 which = 'ptsz'
236 want = 'long'
237 class physical_size(aetools.NProperty):
238 """physical size - the actual space used by the item on disk """
239 which = 'phys'
240 want = 'long'
241 class creation_date(aetools.NProperty):
242 """creation date - the date on which the item was created """
243 which = 'ascd'
244 want = 'ldt '
245 class modification_date(aetools.NProperty):
246 """modification date - the date on which the item was last modified """
247 which = 'asmo'
248 want = 'ldt '
249 class icon(aetools.NProperty):
250 """icon - the icon bitmap of the item """
251 which = 'iimg'
252 want = 'ifam'
253 class selected(aetools.NProperty):
254 """selected - Is the item selected? """
255 which = 'issl'
256 want = 'bool'
257 class content_space(aetools.NProperty):
258 """content space - the window that would open if the item was opened """
259 which = 'dwnd'
260 want = 'obj '
261 class window(aetools.NProperty):
262 """window - the window that would open if the item was opened """
263 which = 'cwin'
264 want = 'obj '
265 class information_window(aetools.NProperty):
266 """information window - the information window for the item """
267 which = 'iwnd'
268 want = 'obj '
270 items = item
271 item._propdict = {
272 'name' : name,
273 'index' : index,
274 'id' : id,
275 'container' : container,
276 'disk' : disk,
277 'folder' : folder,
278 'position' : position,
279 'bounds' : bounds,
280 'label_index' : label_index,
281 'kind' : kind,
282 'description' : description,
283 'comment' : comment,
284 'size' : size,
285 'physical_size' : physical_size,
286 'creation_date' : creation_date,
287 'modification_date' : modification_date,
288 'icon' : icon,
289 'selected' : selected,
290 'content_space' : content_space,
291 'window' : window,
292 'information_window' : information_window,
294 item._elemdict = {
298 # Indices of types declared in this module
300 _classdeclarations = {
301 'cobj' : item,
304 _propdeclarations = {
305 'iwnd' : information_window,
306 'cdis' : disk,
307 'asmo' : modification_date,
308 'ascd' : creation_date,
309 'pnam' : name,
310 'labi' : label_index,
311 'ID ' : id,
312 'iimg' : icon,
313 'pidx' : index,
314 'dwnd' : content_space,
315 'cwin' : window,
316 'comt' : comment,
317 'dscr' : description,
318 'asdr' : folder,
319 'issl' : selected,
320 'pbnd' : bounds,
321 'ctnr' : container,
322 'phys' : physical_size,
323 'ptsz' : size,
324 'kind' : kind,
325 'posn' : position,
328 _compdeclarations = {
331 _enumdeclarations = {