Improved some error messages for command line processing.
[python/dscho.git] / Mac / Lib / lib-scripting / Finder_7_0_Suite.py
blob8d2f96b57caa5b03c79308c85b4620cf242d1ace
1 """Suite 7.0 Finder Suite: This is the original Finder suite. These events will be supported in the future, but the syntax may be changed in a future Finder release.
2 Level 1, version 1
4 Generated from flap:System Folder:Finder
5 AETE/AEUT resource version 0/149, language 0, script 0
6 """
7 # XXXX Hand edited to change the classname
9 import aetools
10 import MacOS
12 _code = 'FNDR'
14 class Finder_7_0_Suite:
16 def open_about_box(self, _no_object=None, _attributes={}, **_arguments):
17 """open about box: Open the 'About This Mac' window
18 Keyword argument _attributes: AppleEvent attribute dictionary
19 """
20 _code = 'aevt'
21 _subcode = 'abou'
23 if _arguments: raise TypeError, 'No optional args expected'
24 if _no_object != None: raise TypeError, 'No direct arg expected'
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_copy_to = {
36 '_from' : 'fsel',
39 def copy_to(self, _object, _attributes={}, **_arguments):
40 """copy to: Copies one or more items into a folder
41 Required argument: Alias for folder into which the items are copied
42 Keyword argument _from: List of aliases for items to be copied
43 Keyword argument _attributes: AppleEvent attribute dictionary
44 """
45 _code = 'FNDR'
46 _subcode = 'drag'
48 aetools.keysubst(_arguments, self._argmap_copy_to)
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 _argmap_duplicate = {
61 'items' : 'fsel',
64 def duplicate(self, _object, _attributes={}, **_arguments):
65 """duplicate: Duplicate a set of items in a folder
66 Required argument: Alias for folder containing the items
67 Keyword argument items: List of aliases for items in the folder
68 Keyword argument _attributes: AppleEvent attribute dictionary
69 """
70 _code = 'FNDR'
71 _subcode = 'sdup'
73 aetools.keysubst(_arguments, self._argmap_duplicate)
74 _arguments['----'] = _object
77 _reply, _arguments, _attributes = self.send(_code, _subcode,
78 _arguments, _attributes)
79 if _arguments.has_key('errn'):
80 raise aetools.Error, aetools.decodeerror(_arguments)
81 # XXXX Optionally decode result
82 if _arguments.has_key('----'):
83 return _arguments['----']
85 def empty_trash(self, _no_object=None, _attributes={}, **_arguments):
86 """empty trash: Empties the trash
87 Keyword argument _attributes: AppleEvent attribute dictionary
88 """
89 _code = 'FNDR'
90 _subcode = 'empt'
92 if _arguments: raise TypeError, 'No optional args expected'
93 if _no_object != None: raise TypeError, 'No direct arg expected'
96 _reply, _arguments, _attributes = self.send(_code, _subcode,
97 _arguments, _attributes)
98 if _arguments.has_key('errn'):
99 raise aetools.Error, aetools.decodeerror(_arguments)
100 # XXXX Optionally decode result
101 if _arguments.has_key('----'):
102 return _arguments['----']
104 _argmap_make_aliases_for = {
105 'items' : 'fsel',
108 def make_aliases_for(self, _object, _attributes={}, **_arguments):
109 """make aliases for: Make aliases to items from a single folder
110 Required argument: Alias for folder containing the items
111 Keyword argument items: List of aliases for items in folder
112 Keyword argument _attributes: AppleEvent attribute dictionary
114 _code = 'FNDR'
115 _subcode = 'sali'
117 aetools.keysubst(_arguments, self._argmap_make_aliases_for)
118 _arguments['----'] = _object
121 _reply, _arguments, _attributes = self.send(_code, _subcode,
122 _arguments, _attributes)
123 if _arguments.has_key('errn'):
124 raise aetools.Error, aetools.decodeerror(_arguments)
125 # XXXX Optionally decode result
126 if _arguments.has_key('----'):
127 return _arguments['----']
129 _argmap_move_to = {
130 '_from' : 'fsel',
133 def move_to(self, _object, _attributes={}, **_arguments):
134 """move to: Move one or more items into a folder
135 Required argument: Alias for destination folder
136 Keyword argument _from: List of aliases for items to be moved
137 Keyword argument _attributes: AppleEvent attribute dictionary
139 _code = 'FNDR'
140 _subcode = 'move'
142 aetools.keysubst(_arguments, self._argmap_move_to)
143 _arguments['----'] = _object
146 _reply, _arguments, _attributes = self.send(_code, _subcode,
147 _arguments, _attributes)
148 if _arguments.has_key('errn'):
149 raise aetools.Error, aetools.decodeerror(_arguments)
150 # XXXX Optionally decode result
151 if _arguments.has_key('----'):
152 return _arguments['----']
154 def sleep(self, _no_object=None, _attributes={}, **_arguments):
155 """sleep: Put portable into sleep mode
156 Keyword argument _attributes: AppleEvent attribute dictionary
158 _code = 'FNDR'
159 _subcode = 'slep'
161 if _arguments: raise TypeError, 'No optional args expected'
162 if _no_object != None: raise TypeError, 'No direct arg expected'
165 _reply, _arguments, _attributes = self.send(_code, _subcode,
166 _arguments, _attributes)
167 if _arguments.has_key('errn'):
168 raise aetools.Error, aetools.decodeerror(_arguments)
169 # XXXX Optionally decode result
170 if _arguments.has_key('----'):
171 return _arguments['----']
173 def shut_down(self, _no_object=None, _attributes={}, **_arguments):
174 """shut down: Shuts down the Macintosh if all applications can quit
175 Keyword argument _attributes: AppleEvent attribute dictionary
177 _code = 'FNDR'
178 _subcode = 'shut'
180 if _arguments: raise TypeError, 'No optional args expected'
181 if _no_object != None: raise TypeError, 'No direct arg expected'
184 _reply, _arguments, _attributes = self.send(_code, _subcode,
185 _arguments, _attributes)
186 if _arguments.has_key('errn'):
187 raise aetools.Error, aetools.decodeerror(_arguments)
188 # XXXX Optionally decode result
189 if _arguments.has_key('----'):
190 return _arguments['----']
192 _argmap_open = {
193 'items' : 'fsel',
196 def open(self, _object, _attributes={}, **_arguments):
197 """open: Open folders, files, or applications from a given folder
198 Required argument: Alias for folder containing the items
199 Keyword argument items: List of aliases for items in the folder
200 Keyword argument _attributes: AppleEvent attribute dictionary
202 _code = 'FNDR'
203 _subcode = 'sope'
205 aetools.keysubst(_arguments, self._argmap_open)
206 _arguments['----'] = _object
209 _reply, _arguments, _attributes = self.send(_code, _subcode,
210 _arguments, _attributes)
211 if _arguments.has_key('errn'):
212 raise aetools.Error, aetools.decodeerror(_arguments)
213 # XXXX Optionally decode result
214 if _arguments.has_key('----'):
215 return _arguments['----']
217 _argmap__print = {
218 'items' : 'fsel',
221 def _print(self, _object, _attributes={}, **_arguments):
222 """print: Print items from a given folder
223 Required argument: Alias for folder containing the items
224 Keyword argument items: List of aliases for items in folder
225 Keyword argument _attributes: AppleEvent attribute dictionary
227 _code = 'FNDR'
228 _subcode = 'spri'
230 aetools.keysubst(_arguments, self._argmap__print)
231 _arguments['----'] = _object
234 _reply, _arguments, _attributes = self.send(_code, _subcode,
235 _arguments, _attributes)
236 if _arguments.has_key('errn'):
237 raise aetools.Error, aetools.decodeerror(_arguments)
238 # XXXX Optionally decode result
239 if _arguments.has_key('----'):
240 return _arguments['----']
242 _argmap_put_away = {
243 'items' : 'fsel',
246 def put_away(self, _object, _attributes={}, **_arguments):
247 """put away: Put away items from a given folder
248 Required argument: Alias for folder containing the items
249 Keyword argument items: List of aliases to items in folder
250 Keyword argument _attributes: AppleEvent attribute dictionary
251 Returns: undocumented, typecode 'alis'
253 _code = 'FNDR'
254 _subcode = 'sput'
256 aetools.keysubst(_arguments, self._argmap_put_away)
257 _arguments['----'] = _object
260 _reply, _arguments, _attributes = self.send(_code, _subcode,
261 _arguments, _attributes)
262 if _arguments.has_key('errn'):
263 raise aetools.Error, aetools.decodeerror(_arguments)
264 # XXXX Optionally decode result
265 if _arguments.has_key('----'):
266 return _arguments['----']
268 def restart(self, _no_object=None, _attributes={}, **_arguments):
269 """restart: Restart the Macintosh
270 Keyword argument _attributes: AppleEvent attribute dictionary
272 _code = 'FNDR'
273 _subcode = 'rest'
275 if _arguments: raise TypeError, 'No optional args expected'
276 if _no_object != None: raise TypeError, 'No direct arg expected'
279 _reply, _arguments, _attributes = self.send(_code, _subcode,
280 _arguments, _attributes)
281 if _arguments.has_key('errn'):
282 raise aetools.Error, aetools.decodeerror(_arguments)
283 # XXXX Optionally decode result
284 if _arguments.has_key('----'):
285 return _arguments['----']
287 _argmap_select = {
288 'items' : 'fsel',
291 def select(self, _object, _attributes={}, **_arguments):
292 """select: Select items in a folder
293 Required argument: Alias for folder containing the items
294 Keyword argument items: List of aliases for items in folder
295 Keyword argument _attributes: AppleEvent attribute dictionary
297 _code = 'FNDR'
298 _subcode = 'srev'
300 aetools.keysubst(_arguments, self._argmap_select)
301 _arguments['----'] = _object
304 _reply, _arguments, _attributes = self.send(_code, _subcode,
305 _arguments, _attributes)
306 if _arguments.has_key('errn'):
307 raise aetools.Error, aetools.decodeerror(_arguments)
308 # XXXX Optionally decode result
309 if _arguments.has_key('----'):
310 return _arguments['----']
314 # Indices of types declared in this module
316 _classdeclarations = {
319 _propdeclarations = {
322 _compdeclarations = {
325 _enumdeclarations = {