Fix three PyChecker-detected gotchas.
[python/dscho.git] / Mac / Lib / lib-scriptpackages / CodeWarrior / CodeWarrior_suite.py
blob26f7d6a62463a8275519cb22590552fdf327cee3
1 """Suite CodeWarrior suite: Terms for scripting the CodeWarrior IDE
2 Level 0, version 0
4 Generated from Macintosh HD:SWdev:CodeWarrior 6 MPTP:Metrowerks CodeWarrior:CodeWarrior IDE 4.1B9
5 AETE/AEUT resource version 1/0, language 0, script 0
6 """
8 import aetools
9 import MacOS
11 _code = 'CWIE'
13 class CodeWarrior_suite_Events:
15 _argmap_add = {
16 'new' : 'kocl',
17 'with_data' : 'data',
18 'to_targets' : 'TTGT',
19 'to_group' : 'TGRP',
22 def add(self, _object, _attributes={}, **_arguments):
23 """add: add elements to a project or target
24 Required argument: an AE object reference
25 Keyword argument new: the class of the new element or elements to add
26 Keyword argument with_data: the initial data for the element or elements
27 Keyword argument to_targets: the targets to which the new element or elements will be added
28 Keyword argument to_group: the group to which the new element or elements will be added
29 Keyword argument _attributes: AppleEvent attribute dictionary
30 """
31 _code = 'CWIE'
32 _subcode = 'ADDF'
34 aetools.keysubst(_arguments, self._argmap_add)
35 _arguments['----'] = _object
38 _reply, _arguments, _attributes = self.send(_code, _subcode,
39 _arguments, _attributes)
40 if _arguments.has_key('errn'):
41 raise aetools.Error, aetools.decodeerror(_arguments)
42 # XXXX Optionally decode result
43 if _arguments.has_key('----'):
44 return _arguments['----']
46 _argmap_export = {
47 '_in' : 'kfil',
50 def export(self, _no_object=None, _attributes={}, **_arguments):
51 """export: Export the project file as an XML file
52 Keyword argument _in: the XML file in which to export the project
53 Keyword argument _attributes: AppleEvent attribute dictionary
54 """
55 _code = 'CWIE'
56 _subcode = 'EXPT'
58 aetools.keysubst(_arguments, self._argmap_export)
59 if _no_object != None: raise TypeError, 'No direct arg expected'
62 _reply, _arguments, _attributes = self.send(_code, _subcode,
63 _arguments, _attributes)
64 if _arguments.has_key('errn'):
65 raise aetools.Error, aetools.decodeerror(_arguments)
66 # XXXX Optionally decode result
67 if _arguments.has_key('----'):
68 return _arguments['----']
70 def update(self, _no_object=None, _attributes={}, **_arguments):
71 """update: bring a project or target up to date
72 Keyword argument _attributes: AppleEvent attribute dictionary
73 """
74 _code = 'CWIE'
75 _subcode = 'UP2D'
77 if _arguments: raise TypeError, 'No optional args expected'
78 if _no_object != None: raise TypeError, 'No direct arg expected'
81 _reply, _arguments, _attributes = self.send(_code, _subcode,
82 _arguments, _attributes)
83 if _arguments.has_key('errn'):
84 raise aetools.Error, aetools.decodeerror(_arguments)
85 # XXXX Optionally decode result
86 if _arguments.has_key('----'):
87 return _arguments['----']
89 def check(self, _object=None, _attributes={}, **_arguments):
90 """check: check the syntax of a file in a project or target
91 Required argument: the file or files to be checked
92 Keyword argument _attributes: AppleEvent attribute dictionary
93 """
94 _code = 'CWIE'
95 _subcode = 'CHEK'
97 if _arguments: raise TypeError, 'No optional args expected'
98 _arguments['----'] = _object
101 _reply, _arguments, _attributes = self.send(_code, _subcode,
102 _arguments, _attributes)
103 if _arguments.has_key('errn'):
104 raise aetools.Error, aetools.decodeerror(_arguments)
105 # XXXX Optionally decode result
106 if _arguments.has_key('----'):
107 return _arguments['----']
109 def compile_file(self, _object=None, _attributes={}, **_arguments):
110 """compile file: compile a file in a project or target
111 Required argument: the file or files to be compiled
112 Keyword argument _attributes: AppleEvent attribute dictionary
114 _code = 'CWIE'
115 _subcode = 'COMP'
117 if _arguments: raise TypeError, 'No optional args expected'
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 def disassemble_file(self, _object=None, _attributes={}, **_arguments):
130 """disassemble file: disassemble a file in a project or target
131 Required argument: the file or files to be disassembled
132 Keyword argument _attributes: AppleEvent attribute dictionary
134 _code = 'CWIE'
135 _subcode = 'DASM'
137 if _arguments: raise TypeError, 'No optional args expected'
138 _arguments['----'] = _object
141 _reply, _arguments, _attributes = self.send(_code, _subcode,
142 _arguments, _attributes)
143 if _arguments.has_key('errn'):
144 raise aetools.Error, aetools.decodeerror(_arguments)
145 # XXXX Optionally decode result
146 if _arguments.has_key('----'):
147 return _arguments['----']
149 def build(self, _no_object=None, _attributes={}, **_arguments):
150 """build: build a project or target (equivalent of the Make menu command)
151 Keyword argument _attributes: AppleEvent attribute dictionary
153 _code = 'CWIE'
154 _subcode = 'MAKE'
156 if _arguments: raise TypeError, 'No optional args expected'
157 if _no_object != None: raise TypeError, 'No direct arg expected'
160 _reply, _arguments, _attributes = self.send(_code, _subcode,
161 _arguments, _attributes)
162 if _arguments.has_key('errn'):
163 raise aetools.Error, aetools.decodeerror(_arguments)
164 # XXXX Optionally decode result
165 if _arguments.has_key('----'):
166 return _arguments['----']
168 def remove_target_files(self, _object, _attributes={}, **_arguments):
169 """remove target files: remove files from a target
170 Required argument: an AE object reference
171 Keyword argument _attributes: AppleEvent attribute dictionary
173 _code = 'CWIE'
174 _subcode = 'RMFL'
176 if _arguments: raise TypeError, 'No optional args expected'
177 _arguments['----'] = _object
180 _reply, _arguments, _attributes = self.send(_code, _subcode,
181 _arguments, _attributes)
182 if _arguments.has_key('errn'):
183 raise aetools.Error, aetools.decodeerror(_arguments)
184 # XXXX Optionally decode result
185 if _arguments.has_key('----'):
186 return _arguments['----']
188 def remove_object_code(self, _no_object=None, _attributes={}, **_arguments):
189 """remove object code: remove object code from a project or target
190 Keyword argument _attributes: AppleEvent attribute dictionary
192 _code = 'CWIE'
193 _subcode = 'RMOB'
195 if _arguments: raise TypeError, 'No optional args expected'
196 if _no_object != None: raise TypeError, 'No direct arg expected'
199 _reply, _arguments, _attributes = self.send(_code, _subcode,
200 _arguments, _attributes)
201 if _arguments.has_key('errn'):
202 raise aetools.Error, aetools.decodeerror(_arguments)
203 # XXXX Optionally decode result
204 if _arguments.has_key('----'):
205 return _arguments['----']
207 def run_target(self, _no_object=None, _attributes={}, **_arguments):
208 """run target: run a project or target
209 Keyword argument _attributes: AppleEvent attribute dictionary
211 _code = 'CWIE'
212 _subcode = 'RUN '
214 if _arguments: raise TypeError, 'No optional args expected'
215 if _no_object != None: raise TypeError, 'No direct arg expected'
218 _reply, _arguments, _attributes = self.send(_code, _subcode,
219 _arguments, _attributes)
220 if _arguments.has_key('errn'):
221 raise aetools.Error, aetools.decodeerror(_arguments)
222 # XXXX Optionally decode result
223 if _arguments.has_key('----'):
224 return _arguments['----']
226 def touch_file(self, _object=None, _attributes={}, **_arguments):
227 """touch file: touch a file in a project or target for compilation
228 Required argument: the file or files to be touched
229 Keyword argument _attributes: AppleEvent attribute dictionary
231 _code = 'CWIE'
232 _subcode = 'TOCH'
234 if _arguments: raise TypeError, 'No optional args expected'
235 _arguments['----'] = _object
238 _reply, _arguments, _attributes = self.send(_code, _subcode,
239 _arguments, _attributes)
240 if _arguments.has_key('errn'):
241 raise aetools.Error, aetools.decodeerror(_arguments)
242 # XXXX Optionally decode result
243 if _arguments.has_key('----'):
244 return _arguments['----']
247 class build_progress_document(aetools.ComponentItem):
248 """build progress document - a build progress document """
249 want = 'PRGS'
250 class inherits(aetools.NProperty):
251 """inherits - all properties and elements of the given class are inherited by this class. """
252 which = 'c@#^'
253 want = 'docu'
255 build_progress_documents = build_progress_document
257 class catalog_document(aetools.ComponentItem):
258 """catalog document - a browser catalog document """
259 want = 'CTLG'
260 # repeated property inherits all properties and elements of the given class are inherited by this class.
262 catalog_documents = catalog_document
264 class class_browser(aetools.ComponentItem):
265 """class browser - a class browser """
266 want = 'BROW'
267 # repeated property inherits all properties and elements of the given class are inherited by this class.
269 class_browsers = class_browser
271 class class_hierarchy(aetools.ComponentItem):
272 """class hierarchy - a class hierarchy document """
273 want = 'HIER'
274 # repeated property inherits all properties and elements of the given class are inherited by this class.
276 class_hierarchies = class_hierarchy
278 class editor_document(aetools.ComponentItem):
279 """editor document - an editor document """
280 want = 'EDIT'
281 # repeated property inherits all properties and elements of the given class are inherited by this class.
283 editor_documents = editor_document
285 class file_compare_document(aetools.ComponentItem):
286 """file compare document - a file compare document """
287 want = 'COMP'
288 # repeated property inherits all properties and elements of the given class are inherited by this class.
290 file_compare_documents = file_compare_document
292 class message_document(aetools.ComponentItem):
293 """message document - a message document """
294 want = 'MSSG'
295 # repeated property inherits all properties and elements of the given class are inherited by this class.
297 message_documents = message_document
299 class project_document(aetools.ComponentItem):
300 """project document - a project document """
301 want = 'PRJD'
302 # repeated property inherits all properties and elements of the given class are inherited by this class.
303 class current_target(aetools.NProperty):
304 """current target - the current target """
305 which = 'CURT'
306 want = 'TRGT'
307 # element 'TRGT' as ['indx', 'name', 'test', 'rang']
309 project_documents = project_document
311 class project_inspector(aetools.ComponentItem):
312 """project inspector - the project inspector """
313 want = 'INSP'
314 # repeated property inherits all properties and elements of the given class are inherited by this class.
316 project_inspectors = project_inspector
318 class single_class_browser(aetools.ComponentItem):
319 """single class browser - a single class browser """
320 want = '1BRW'
321 # repeated property inherits all properties and elements of the given class are inherited by this class.
323 single_class_browsers = single_class_browser
325 class single_class_hierarchy(aetools.ComponentItem):
326 """single class hierarchy - a single class hierarchy document """
327 want = '1HIR'
328 # repeated property inherits all properties and elements of the given class are inherited by this class.
330 single_class_hierarchies = single_class_hierarchy
332 class subtarget(aetools.ComponentItem):
333 """subtarget - a target that is prerequisite for another target """
334 want = 'SBTG'
335 # repeated property inherits all properties and elements of the given class are inherited by this class.
336 class target(aetools.NProperty):
337 """target - the target that is dependent on this subtarget """
338 which = 'TrgT'
339 want = 'TRGT'
340 class link_against_output(aetools.NProperty):
341 """link against output - is the output of this subtarget linked into its dependent target? """
342 which = 'LNKO'
343 want = 'bool'
345 subtargets = subtarget
347 class symbol_browser(aetools.ComponentItem):
348 """symbol browser - a symbol browser """
349 want = 'SYMB'
350 # repeated property inherits all properties and elements of the given class are inherited by this class.
352 symbol_browsers = symbol_browser
354 class target(aetools.ComponentItem):
355 """target - a target in a project """
356 want = 'TRGT'
357 class name(aetools.NProperty):
358 """name - """
359 which = 'pnam'
360 want = 'itxt'
361 class index(aetools.NProperty):
362 """index - the number of the target """
363 which = 'pidx'
364 want = 'long'
365 class project_document(aetools.NProperty):
366 """project document - the project document that contains this target """
367 which = 'PrjD'
368 want = 'PRJD'
369 # element 'SRCF' as ['indx', 'test', 'rang']
370 # element 'SBTG' as ['indx', 'test', 'rang']
372 targets = target
374 class target_file(aetools.ComponentItem):
375 """target file - a source or header file in a target """
376 want = 'SRCF'
377 class id(aetools.NProperty):
378 """id - the unique ID number of the target file """
379 which = 'ID '
380 want = 'long'
381 class type(aetools.NProperty):
382 """type - the type of source file """
383 which = 'FTYP'
384 want = 'FTYP'
385 # repeated property index the number of the target file
386 class location(aetools.NProperty):
387 """location - the location of the target file on disk """
388 which = 'FILE'
389 want = 'fss '
390 class path(aetools.NProperty):
391 """path - the path of the source file on disk """
392 which = 'Path'
393 want = 'itxt'
394 class linked(aetools.NProperty):
395 """linked - is the source file in the link order of its target? """
396 which = 'LINK'
397 want = 'bool'
398 class link_index(aetools.NProperty):
399 """link index - the index of the source file in its target¹s link order (-1 if source file is not in link order) """
400 which = 'LIDX'
401 want = 'long'
402 class modified_date(aetools.NProperty):
403 """modified date - the date and time this source file was last modified """
404 which = 'MODD'
405 want = 'ldt '
406 class compiled_date(aetools.NProperty):
407 """compiled date - the date and this source file was last compiled """
408 which = 'CMPD'
409 want = 'ldt '
410 class code_size(aetools.NProperty):
411 """code size - the size of the code (in bytes) produced by compiling this source file """
412 which = 'CSZE'
413 want = 'long'
414 class data_size(aetools.NProperty):
415 """data size - the size of the date (in bytes) produced by compiling this source file """
416 which = 'DSZE'
417 want = 'long'
418 class debug(aetools.NProperty):
419 """debug - is debugging information generated for this source file? """
420 which = 'DBUG'
421 want = 'bool'
422 class weak_link(aetools.NProperty):
423 """weak link - is this shared library linked weakly? """
424 which = 'WEAK'
425 want = 'bool'
426 class init_before(aetools.NProperty):
427 """init before - is the Œinitialize before¹ flag set for this shared library? """
428 which = 'INIT'
429 want = 'bool'
430 class merge_output(aetools.NProperty):
431 """merge output - is this shared library merged into another code fragment? """
432 which = 'MRGE'
433 want = 'bool'
434 class prerequisites(aetools.NProperty):
435 """prerequisites - the source files needed to build this source file """
436 which = 'PRER'
437 want = 'list'
438 class dependents(aetools.NProperty):
439 """dependents - the source files that need this source file in order to build """
440 which = 'DPND'
441 want = 'list'
443 target_files = target_file
445 class text_document(aetools.ComponentItem):
446 """text document - a document that contains text """
447 want = 'TXTD'
448 # repeated property inherits all properties and elements of the given class are inherited by this class.
449 class modified(aetools.NProperty):
450 """modified - Has the document been modified since the last save? """
451 which = 'imod'
452 want = 'bool'
453 class selection(aetools.NProperty):
454 """selection - the selection visible to the user """
455 which = 'sele'
456 want = 'csel'
457 # element 'cha ' as ['indx', 'rele', 'rang', 'test']
458 # element 'cins' as ['rele']
459 # element 'clin' as ['indx', 'rang', 'rele']
460 # element 'ctxt' as ['rang']
462 text_documents = text_document
464 class ToolServer_worksheet(aetools.ComponentItem):
465 """ToolServer worksheet - a ToolServer worksheet """
466 want = 'TOOL'
467 # repeated property inherits all properties and elements of the given class are inherited by this class.
469 ToolServer_worksheets = ToolServer_worksheet
470 build_progress_document._propdict = {
471 'inherits' : inherits,
473 build_progress_document._elemdict = {
475 catalog_document._propdict = {
476 'inherits' : inherits,
478 catalog_document._elemdict = {
480 class_browser._propdict = {
481 'inherits' : inherits,
483 class_browser._elemdict = {
485 class_hierarchy._propdict = {
486 'inherits' : inherits,
488 class_hierarchy._elemdict = {
490 editor_document._propdict = {
491 'inherits' : inherits,
493 editor_document._elemdict = {
495 file_compare_document._propdict = {
496 'inherits' : inherits,
498 file_compare_document._elemdict = {
500 message_document._propdict = {
501 'inherits' : inherits,
503 message_document._elemdict = {
505 project_document._propdict = {
506 'inherits' : inherits,
507 'current_target' : current_target,
509 project_document._elemdict = {
510 'target' : target,
512 project_inspector._propdict = {
513 'inherits' : inherits,
515 project_inspector._elemdict = {
517 single_class_browser._propdict = {
518 'inherits' : inherits,
520 single_class_browser._elemdict = {
522 single_class_hierarchy._propdict = {
523 'inherits' : inherits,
525 single_class_hierarchy._elemdict = {
527 subtarget._propdict = {
528 'inherits' : inherits,
529 'target' : target,
530 'link_against_output' : link_against_output,
532 subtarget._elemdict = {
534 symbol_browser._propdict = {
535 'inherits' : inherits,
537 symbol_browser._elemdict = {
539 target._propdict = {
540 'name' : name,
541 'index' : index,
542 'project_document' : project_document,
544 target._elemdict = {
545 'target_file' : target_file,
546 'subtarget' : subtarget,
548 target_file._propdict = {
549 'id' : id,
550 'type' : type,
551 'index' : index,
552 'location' : location,
553 'path' : path,
554 'linked' : linked,
555 'link_index' : link_index,
556 'modified_date' : modified_date,
557 'compiled_date' : compiled_date,
558 'code_size' : code_size,
559 'data_size' : data_size,
560 'debug' : debug,
561 'weak_link' : weak_link,
562 'init_before' : init_before,
563 'merge_output' : merge_output,
564 'prerequisites' : prerequisites,
565 'dependents' : dependents,
567 target_file._elemdict = {
569 import Standard_Suite
570 text_document._propdict = {
571 'inherits' : inherits,
572 'modified' : modified,
573 'selection' : selection,
575 text_document._elemdict = {
576 'character' : Standard_Suite.character,
577 'insertion_point' : Standard_Suite.insertion_point,
578 'line' : Standard_Suite.line,
579 'text' : Standard_Suite.text,
581 ToolServer_worksheet._propdict = {
582 'inherits' : inherits,
584 ToolServer_worksheet._elemdict = {
586 _Enum_Inte = {
587 'never_interact' : 'eNvr', # never allow user interactions
588 'interact_with_self' : 'eInS', # allow user interaction only when an AppleEvent is sent from within CodeWarrior
589 'interact_with_local' : 'eInL', # allow user interaction when AppleEvents are sent from applications on the same machine (default)
590 'interact_with_all' : 'eInA', # allow user interaction from both local and remote AppleEvents
593 _Enum_DKND = {
594 'project' : 'PRJD', # a project document
595 'editor_document' : 'EDIT', # an editor document
596 'message' : 'MSSG', # a message document
597 'file_compare' : 'COMP', # a file compare document
598 'catalog_document' : 'CTLG', # a browser catalog
599 'class_browser' : 'BROW', # a class browser document
600 'single_class_browser' : '1BRW', # a single class browser document
601 'symbol_browser' : 'SYMB', # a symbol browser document
602 'class_hierarchy' : 'HIER', # a class hierarchy document
603 'single_class_hierarchy' : '1HIR', # a single class hierarchy document
604 'project_inspector' : 'INSP', # a project inspector
605 'ToolServer_worksheet' : 'TOOL', # the ToolServer worksheet
606 'build_progress_document' : 'PRGS', # the build progress window
609 _Enum_FTYP = {
610 'library_file' : 'LIBF', # a library file
611 'project_file' : 'PRJF', # a project file
612 'resource_file' : 'RESF', # a resource file
613 'text_file' : 'TXTF', # a text file
614 'unknown_file' : 'UNKN', # unknown file type
617 _Enum_PERM = {
618 'read_write' : 'RdWr', # the file is open with read/write permission
619 'read_only' : 'Read', # the file is open with read/only permission
620 'checked_out_read_write' : 'CkRW', # the file is checked out with read/write permission
621 'checked_out_read_only' : 'CkRO', # the file is checked out with read/only permission
622 'checked_out_read_modify' : 'CkRM', # the file is checked out with read/modify permission
623 'locked' : 'Lock', # the file is locked on disk
624 'none' : 'LNNO', # the file is new
629 # Indices of types declared in this module
631 _classdeclarations = {
632 'TOOL' : ToolServer_worksheet,
633 '1HIR' : single_class_hierarchy,
634 'SRCF' : target_file,
635 'TXTD' : text_document,
636 'TRGT' : target,
637 'HIER' : class_hierarchy,
638 'CTLG' : catalog_document,
639 '1BRW' : single_class_browser,
640 'MSSG' : message_document,
641 'INSP' : project_inspector,
642 'BROW' : class_browser,
643 'COMP' : file_compare_document,
644 'EDIT' : editor_document,
645 'PRJD' : project_document,
646 'SBTG' : subtarget,
647 'SYMB' : symbol_browser,
648 'PRGS' : build_progress_document,
651 _propdeclarations = {
652 'PRER' : prerequisites,
653 'DBUG' : debug,
654 'CSZE' : code_size,
655 'Path' : path,
656 'pnam' : name,
657 'TrgT' : target,
658 'DSZE' : data_size,
659 'FTYP' : type,
660 'MODD' : modified_date,
661 'INIT' : init_before,
662 'sele' : selection,
663 'imod' : modified,
664 'DPND' : dependents,
665 'FILE' : location,
666 'LIDX' : link_index,
667 'LINK' : linked,
668 'ID ' : id,
669 'c@#^' : inherits,
670 'pidx' : index,
671 'LNKO' : link_against_output,
672 'WEAK' : weak_link,
673 'MRGE' : merge_output,
674 'CMPD' : compiled_date,
675 'PrjD' : project_document,
676 'CURT' : current_target,
679 _compdeclarations = {
682 _enumdeclarations = {
683 'PERM' : _Enum_PERM,
684 'FTYP' : _Enum_FTYP,
685 'DKND' : _Enum_DKND,
686 'Inte' : _Enum_Inte,