PageRenderTime 643ms CodeModel.GetById 174ms app.highlight 296ms RepoModel.GetById 167ms app.codeStats 0ms

/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py

http://unladen-swallow.googlecode.com/
Python | 682 lines | 478 code | 92 blank | 112 comment | 41 complexity | 718a8dd0846bc8c3548af547f8c2b291 MD5 | raw file
  1"""Suite CodeWarrior suite: Terms for scripting the CodeWarrior IDE
  2Level 0, version 0
  3
  4Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
  5AETE/AEUT resource version 1/0, language 0, script 0
  6"""
  7
  8import aetools
  9import MacOS
 10
 11_code = 'CWIE'
 12
 13class CodeWarrior_suite_Events:
 14
 15    _argmap_add = {
 16        'new' : 'kocl',
 17        'with_data' : 'data',
 18        'to_targets' : 'TTGT',
 19        'to_group' : 'TGRP',
 20    }
 21
 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'
 33
 34        aetools.keysubst(_arguments, self._argmap_add)
 35        _arguments['----'] = _object
 36
 37
 38        _reply, _arguments, _attributes = self.send(_code, _subcode,
 39                _arguments, _attributes)
 40        if _arguments.get('errn', 0):
 41            raise aetools.Error, aetools.decodeerror(_arguments)
 42        # XXXX Optionally decode result
 43        if _arguments.has_key('----'):
 44            return _arguments['----']
 45
 46    def build(self, _no_object=None, _attributes={}, **_arguments):
 47        """build: build a project or target (equivalent of the Make menu command)
 48        Keyword argument _attributes: AppleEvent attribute dictionary
 49        """
 50        _code = 'CWIE'
 51        _subcode = 'MAKE'
 52
 53        if _arguments: raise TypeError, 'No optional args expected'
 54        if _no_object is not None: raise TypeError, 'No direct arg expected'
 55
 56
 57        _reply, _arguments, _attributes = self.send(_code, _subcode,
 58                _arguments, _attributes)
 59        if _arguments.get('errn', 0):
 60            raise aetools.Error, aetools.decodeerror(_arguments)
 61        # XXXX Optionally decode result
 62        if _arguments.has_key('----'):
 63            return _arguments['----']
 64
 65    def check(self, _object=None, _attributes={}, **_arguments):
 66        """check: check the syntax of a file in a project or target
 67        Required argument: the file or files to be checked
 68        Keyword argument _attributes: AppleEvent attribute dictionary
 69        """
 70        _code = 'CWIE'
 71        _subcode = 'CHEK'
 72
 73        if _arguments: raise TypeError, 'No optional args expected'
 74        _arguments['----'] = _object
 75
 76
 77        _reply, _arguments, _attributes = self.send(_code, _subcode,
 78                _arguments, _attributes)
 79        if _arguments.get('errn', 0):
 80            raise aetools.Error, aetools.decodeerror(_arguments)
 81        # XXXX Optionally decode result
 82        if _arguments.has_key('----'):
 83            return _arguments['----']
 84
 85    def compile_file(self, _object=None, _attributes={}, **_arguments):
 86        """compile file: compile a file in a project or target
 87        Required argument: the file or files to be compiled
 88        Keyword argument _attributes: AppleEvent attribute dictionary
 89        """
 90        _code = 'CWIE'
 91        _subcode = 'COMP'
 92
 93        if _arguments: raise TypeError, 'No optional args expected'
 94        _arguments['----'] = _object
 95
 96
 97        _reply, _arguments, _attributes = self.send(_code, _subcode,
 98                _arguments, _attributes)
 99        if _arguments.get('errn', 0):
100            raise aetools.Error, aetools.decodeerror(_arguments)
101        # XXXX Optionally decode result
102        if _arguments.has_key('----'):
103            return _arguments['----']
104
105    def disassemble_file(self, _object=None, _attributes={}, **_arguments):
106        """disassemble file: disassemble a file in a project or target
107        Required argument: the file or files to be disassembled
108        Keyword argument _attributes: AppleEvent attribute dictionary
109        """
110        _code = 'CWIE'
111        _subcode = 'DASM'
112
113        if _arguments: raise TypeError, 'No optional args expected'
114        _arguments['----'] = _object
115
116
117        _reply, _arguments, _attributes = self.send(_code, _subcode,
118                _arguments, _attributes)
119        if _arguments.get('errn', 0):
120            raise aetools.Error, aetools.decodeerror(_arguments)
121        # XXXX Optionally decode result
122        if _arguments.has_key('----'):
123            return _arguments['----']
124
125    _argmap_export = {
126        'in_' : 'kfil',
127    }
128
129    def export(self, _no_object=None, _attributes={}, **_arguments):
130        """export: Export the project file as an XML file
131        Keyword argument in_: the XML file in which to export the project
132        Keyword argument _attributes: AppleEvent attribute dictionary
133        """
134        _code = 'CWIE'
135        _subcode = 'EXPT'
136
137        aetools.keysubst(_arguments, self._argmap_export)
138        if _no_object is not None: raise TypeError, 'No direct arg expected'
139
140
141        _reply, _arguments, _attributes = self.send(_code, _subcode,
142                _arguments, _attributes)
143        if _arguments.get('errn', 0):
144            raise aetools.Error, aetools.decodeerror(_arguments)
145        # XXXX Optionally decode result
146        if _arguments.has_key('----'):
147            return _arguments['----']
148
149    def remove_object_code(self, _no_object=None, _attributes={}, **_arguments):
150        """remove object code: remove object code from a project or target
151        Keyword argument _attributes: AppleEvent attribute dictionary
152        """
153        _code = 'CWIE'
154        _subcode = 'RMOB'
155
156        if _arguments: raise TypeError, 'No optional args expected'
157        if _no_object is not None: raise TypeError, 'No direct arg expected'
158
159
160        _reply, _arguments, _attributes = self.send(_code, _subcode,
161                _arguments, _attributes)
162        if _arguments.get('errn', 0):
163            raise aetools.Error, aetools.decodeerror(_arguments)
164        # XXXX Optionally decode result
165        if _arguments.has_key('----'):
166            return _arguments['----']
167
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
172        """
173        _code = 'CWIE'
174        _subcode = 'RMFL'
175
176        if _arguments: raise TypeError, 'No optional args expected'
177        _arguments['----'] = _object
178
179
180        _reply, _arguments, _attributes = self.send(_code, _subcode,
181                _arguments, _attributes)
182        if _arguments.get('errn', 0):
183            raise aetools.Error, aetools.decodeerror(_arguments)
184        # XXXX Optionally decode result
185        if _arguments.has_key('----'):
186            return _arguments['----']
187
188    def run_target(self, _no_object=None, _attributes={}, **_arguments):
189        """run target: run a project or target
190        Keyword argument _attributes: AppleEvent attribute dictionary
191        """
192        _code = 'CWIE'
193        _subcode = 'RUN '
194
195        if _arguments: raise TypeError, 'No optional args expected'
196        if _no_object is not None: raise TypeError, 'No direct arg expected'
197
198
199        _reply, _arguments, _attributes = self.send(_code, _subcode,
200                _arguments, _attributes)
201        if _arguments.get('errn', 0):
202            raise aetools.Error, aetools.decodeerror(_arguments)
203        # XXXX Optionally decode result
204        if _arguments.has_key('----'):
205            return _arguments['----']
206
207    def touch_file(self, _object=None, _attributes={}, **_arguments):
208        """touch file: touch a file in a project or target for compilation
209        Required argument: the file or files to be touched
210        Keyword argument _attributes: AppleEvent attribute dictionary
211        """
212        _code = 'CWIE'
213        _subcode = 'TOCH'
214
215        if _arguments: raise TypeError, 'No optional args expected'
216        _arguments['----'] = _object
217
218
219        _reply, _arguments, _attributes = self.send(_code, _subcode,
220                _arguments, _attributes)
221        if _arguments.get('errn', 0):
222            raise aetools.Error, aetools.decodeerror(_arguments)
223        # XXXX Optionally decode result
224        if _arguments.has_key('----'):
225            return _arguments['----']
226
227    def update(self, _no_object=None, _attributes={}, **_arguments):
228        """update: bring a project or target up to date
229        Keyword argument _attributes: AppleEvent attribute dictionary
230        """
231        _code = 'CWIE'
232        _subcode = 'UP2D'
233
234        if _arguments: raise TypeError, 'No optional args expected'
235        if _no_object is not None: raise TypeError, 'No direct arg expected'
236
237
238        _reply, _arguments, _attributes = self.send(_code, _subcode,
239                _arguments, _attributes)
240        if _arguments.get('errn', 0):
241            raise aetools.Error, aetools.decodeerror(_arguments)
242        # XXXX Optionally decode result
243        if _arguments.has_key('----'):
244            return _arguments['----']
245
246
247class single_class_browser(aetools.ComponentItem):
248    """single class browser - a single class browser """
249    want = '1BRW'
250class _Prop_inherits(aetools.NProperty):
251    """inherits - all properties and elements of the given class are inherited by this class. """
252    which = 'c@#^'
253    want = 'TXTD'
254
255single_class_browsers = single_class_browser
256
257class single_class_hierarchy(aetools.ComponentItem):
258    """single class hierarchy - a single class hierarchy document """
259    want = '1HIR'
260
261single_class_hierarchies = single_class_hierarchy
262
263class class_browser(aetools.ComponentItem):
264    """class browser - a class browser """
265    want = 'BROW'
266
267class_browsers = class_browser
268
269class file_compare_document(aetools.ComponentItem):
270    """file compare document - a file compare document """
271    want = 'COMP'
272
273file_compare_documents = file_compare_document
274
275class catalog_document(aetools.ComponentItem):
276    """catalog document - a browser catalog document """
277    want = 'CTLG'
278
279catalog_documents = catalog_document
280
281class editor_document(aetools.ComponentItem):
282    """editor document - an editor document """
283    want = 'EDIT'
284
285editor_documents = editor_document
286
287class class_hierarchy(aetools.ComponentItem):
288    """class hierarchy - a class hierarchy document """
289    want = 'HIER'
290
291class_hierarchies = class_hierarchy
292
293class project_inspector(aetools.ComponentItem):
294    """project inspector - the project inspector """
295    want = 'INSP'
296
297project_inspectors = project_inspector
298
299class message_document(aetools.ComponentItem):
300    """message document - a message document """
301    want = 'MSSG'
302
303message_documents = message_document
304
305class build_progress_document(aetools.ComponentItem):
306    """build progress document - a build progress document """
307    want = 'PRGS'
308
309build_progress_documents = build_progress_document
310
311class project_document(aetools.ComponentItem):
312    """project document - a project document """
313    want = 'PRJD'
314class _Prop_current_target(aetools.NProperty):
315    """current target - the current target """
316    which = 'CURT'
317    want = 'TRGT'
318#        element 'TRGT' as ['indx', 'name', 'test', 'rang']
319
320project_documents = project_document
321
322class subtarget(aetools.ComponentItem):
323    """subtarget - a target that is prerequisite for another target """
324    want = 'SBTG'
325class _Prop_link_against_output(aetools.NProperty):
326    """link against output - is the output of this subtarget linked into its dependent target? """
327    which = 'LNKO'
328    want = 'bool'
329class _Prop_target(aetools.NProperty):
330    """target - the target that is dependent on this subtarget """
331    which = 'TrgT'
332    want = 'TRGT'
333
334subtargets = subtarget
335
336class target_file(aetools.ComponentItem):
337    """target file - a source or header file in a target """
338    want = 'SRCF'
339class _Prop_code_size(aetools.NProperty):
340    """code size - the size of the code (in bytes) produced by compiling this source file """
341    which = 'CSZE'
342    want = 'long'
343class _Prop_compiled_date(aetools.NProperty):
344    """compiled date - the date and this source file was last compiled """
345    which = 'CMPD'
346    want = 'ldt '
347class _Prop_data_size(aetools.NProperty):
348    """data size - the size of the date (in bytes) produced by compiling this source file """
349    which = 'DSZE'
350    want = 'long'
351class _Prop_debug(aetools.NProperty):
352    """debug - is debugging information generated for this source file? """
353    which = 'DBUG'
354    want = 'bool'
355class _Prop_dependents(aetools.NProperty):
356    """dependents - the source files that need this source file in order to build """
357    which = 'DPND'
358    want = 'list'
359class _Prop_id(aetools.NProperty):
360    """id - the unique ID number of the target file """
361    which = 'ID  '
362    want = 'long'
363class _Prop_init_before(aetools.NProperty):
364    """init before - is the \xd4initialize before\xd5 flag set for this shared library? """
365    which = 'INIT'
366    want = 'bool'
367class _Prop_link_index(aetools.NProperty):
368    """link index - the index of the source file in its target\xd5s link order (-1 if source file is not in link order) """
369    which = 'LIDX'
370    want = 'long'
371class _Prop_linked(aetools.NProperty):
372    """linked - is the source file in the link order of its target? """
373    which = 'LINK'
374    want = 'bool'
375class _Prop_location(aetools.NProperty):
376    """location - the location of the target file on disk """
377    which = 'FILE'
378    want = 'fss '
379class _Prop_merge_output(aetools.NProperty):
380    """merge output - is this shared library merged into another code fragment? """
381    which = 'MRGE'
382    want = 'bool'
383class _Prop_modified_date(aetools.NProperty):
384    """modified date - the date and time this source file was last modified """
385    which = 'MODD'
386    want = 'ldt '
387class _Prop_path(aetools.NProperty):
388    """path - the path of the source file on disk """
389    which = 'Path'
390    want = 'itxt'
391class _Prop_prerequisites(aetools.NProperty):
392    """prerequisites - the source files needed to build this source file """
393    which = 'PRER'
394    want = 'list'
395class _Prop_type(aetools.NProperty):
396    """type - the type of source file """
397    which = 'FTYP'
398    want = 'FTYP'
399class _Prop_weak_link(aetools.NProperty):
400    """weak link - is this shared library linked weakly? """
401    which = 'WEAK'
402    want = 'bool'
403
404target_files = target_file
405
406class symbol_browser(aetools.ComponentItem):
407    """symbol browser - a symbol browser """
408    want = 'SYMB'
409
410symbol_browsers = symbol_browser
411
412class ToolServer_worksheet(aetools.ComponentItem):
413    """ToolServer worksheet - a ToolServer worksheet """
414    want = 'TOOL'
415
416ToolServer_worksheets = ToolServer_worksheet
417
418class target(aetools.ComponentItem):
419    """target - a target in a project """
420    want = 'TRGT'
421class _Prop_name(aetools.NProperty):
422    """name -  """
423    which = 'pnam'
424    want = 'itxt'
425class _Prop_project_document(aetools.NProperty):
426    """project document - the project document that contains this target """
427    which = 'PrjD'
428    want = 'PRJD'
429#        element 'SBTG' as ['indx', 'test', 'rang']
430#        element 'SRCF' as ['indx', 'test', 'rang']
431
432targets = target
433
434class text_document(aetools.ComponentItem):
435    """text document - a document that contains text """
436    want = 'TXTD'
437class _Prop_modified(aetools.NProperty):
438    """modified - Has the document been modified since the last save? """
439    which = 'imod'
440    want = 'bool'
441class _Prop_selection(aetools.NProperty):
442    """selection - the selection visible to the user """
443    which = 'sele'
444    want = 'csel'
445#        element 'cha ' as ['indx', 'rele', 'rang', 'test']
446#        element 'cins' as ['rele']
447#        element 'clin' as ['indx', 'rang', 'rele']
448#        element 'ctxt' as ['rang']
449
450text_documents = text_document
451single_class_browser._superclassnames = ['text_document']
452single_class_browser._privpropdict = {
453    'inherits' : _Prop_inherits,
454}
455single_class_browser._privelemdict = {
456}
457import Standard_Suite
458single_class_hierarchy._superclassnames = ['document']
459single_class_hierarchy._privpropdict = {
460    'inherits' : _Prop_inherits,
461}
462single_class_hierarchy._privelemdict = {
463}
464class_browser._superclassnames = ['text_document']
465class_browser._privpropdict = {
466    'inherits' : _Prop_inherits,
467}
468class_browser._privelemdict = {
469}
470file_compare_document._superclassnames = ['text_document']
471file_compare_document._privpropdict = {
472    'inherits' : _Prop_inherits,
473}
474file_compare_document._privelemdict = {
475}
476catalog_document._superclassnames = ['text_document']
477catalog_document._privpropdict = {
478    'inherits' : _Prop_inherits,
479}
480catalog_document._privelemdict = {
481}
482editor_document._superclassnames = ['text_document']
483editor_document._privpropdict = {
484    'inherits' : _Prop_inherits,
485}
486editor_document._privelemdict = {
487}
488class_hierarchy._superclassnames = ['document']
489class_hierarchy._privpropdict = {
490    'inherits' : _Prop_inherits,
491}
492class_hierarchy._privelemdict = {
493}
494project_inspector._superclassnames = ['document']
495project_inspector._privpropdict = {
496    'inherits' : _Prop_inherits,
497}
498project_inspector._privelemdict = {
499}
500message_document._superclassnames = ['text_document']
501message_document._privpropdict = {
502    'inherits' : _Prop_inherits,
503}
504message_document._privelemdict = {
505}
506build_progress_document._superclassnames = ['document']
507build_progress_document._privpropdict = {
508    'inherits' : _Prop_inherits,
509}
510build_progress_document._privelemdict = {
511}
512project_document._superclassnames = ['document']
513project_document._privpropdict = {
514    'current_target' : _Prop_current_target,
515    'inherits' : _Prop_inherits,
516}
517project_document._privelemdict = {
518    'target' : target,
519}
520subtarget._superclassnames = ['target']
521subtarget._privpropdict = {
522    'inherits' : _Prop_inherits,
523    'link_against_output' : _Prop_link_against_output,
524    'target' : _Prop_target,
525}
526subtarget._privelemdict = {
527}
528target_file._superclassnames = []
529target_file._privpropdict = {
530    'code_size' : _Prop_code_size,
531    'compiled_date' : _Prop_compiled_date,
532    'data_size' : _Prop_data_size,
533    'debug' : _Prop_debug,
534    'dependents' : _Prop_dependents,
535    'id' : _Prop_id,
536    'init_before' : _Prop_init_before,
537    'link_index' : _Prop_link_index,
538    'linked' : _Prop_linked,
539    'location' : _Prop_location,
540    'merge_output' : _Prop_merge_output,
541    'modified_date' : _Prop_modified_date,
542    'path' : _Prop_path,
543    'prerequisites' : _Prop_prerequisites,
544    'type' : _Prop_type,
545    'weak_link' : _Prop_weak_link,
546}
547target_file._privelemdict = {
548}
549symbol_browser._superclassnames = ['text_document']
550symbol_browser._privpropdict = {
551    'inherits' : _Prop_inherits,
552}
553symbol_browser._privelemdict = {
554}
555ToolServer_worksheet._superclassnames = ['text_document']
556ToolServer_worksheet._privpropdict = {
557    'inherits' : _Prop_inherits,
558}
559ToolServer_worksheet._privelemdict = {
560}
561target._superclassnames = []
562target._privpropdict = {
563    'name' : _Prop_name,
564    'project_document' : _Prop_project_document,
565}
566target._privelemdict = {
567    'subtarget' : subtarget,
568    'target_file' : target_file,
569}
570text_document._superclassnames = ['document']
571text_document._privpropdict = {
572    'inherits' : _Prop_inherits,
573    'modified' : _Prop_modified,
574    'selection' : _Prop_selection,
575}
576text_document._privelemdict = {
577    'character' : Standard_Suite.character,
578    'insertion_point' : Standard_Suite.insertion_point,
579    'line' : Standard_Suite.line,
580    'text' : Standard_Suite.text,
581}
582_Enum_DKND = {
583    'project' : 'PRJD', # a project document
584    'editor_document' : 'EDIT', # an editor document
585    'message' : 'MSSG', # a message document
586    'file_compare' : 'COMP',    # a file compare document
587    'catalog_document' : 'CTLG',        # a browser catalog
588    'class_browser' : 'BROW',   # a class browser document
589    'single_class_browser' : '1BRW',    # a single class browser document
590    'symbol_browser' : 'SYMB',  # a symbol browser document
591    'class_hierarchy' : 'HIER', # a class hierarchy document
592    'single_class_hierarchy' : '1HIR',  # a single class hierarchy document
593    'project_inspector' : 'INSP',       # a project inspector
594    'ToolServer_worksheet' : 'TOOL',    # the ToolServer worksheet
595    'build_progress_document' : 'PRGS', # the build progress window
596}
597
598_Enum_FTYP = {
599    'library_file' : 'LIBF',    # a library file
600    'project_file' : 'PRJF',    # a project file
601    'resource_file' : 'RESF',   # a resource file
602    'text_file' : 'TXTF',       # a text file
603    'unknown_file' : 'UNKN',    # unknown file type
604}
605
606_Enum_Inte = {
607    'never_interact' : 'eNvr',  # never allow user interactions
608    'interact_with_self' : 'eInS',      # allow user interaction only when an AppleEvent is sent from within CodeWarrior
609    'interact_with_local' : 'eInL',     # allow user interaction when AppleEvents are sent from applications on the same machine (default)
610    'interact_with_all' : 'eInA',       # allow user interaction from both local and remote AppleEvents
611}
612
613_Enum_PERM = {
614    'read_write' : 'RdWr',      # the file is open with read/write permission
615    'read_only' : 'Read',       # the file is open with read/only permission
616    'checked_out_read_write' : 'CkRW',  # the file is checked out with read/write permission
617    'checked_out_read_only' : 'CkRO',   # the file is checked out with read/only permission
618    'checked_out_read_modify' : 'CkRM', # the file is checked out with read/modify permission
619    'locked' : 'Lock',  # the file is locked on disk
620    'none' : 'LNNO',    # the file is new
621}
622
623
624#
625# Indices of types declared in this module
626#
627_classdeclarations = {
628    '1BRW' : single_class_browser,
629    '1HIR' : single_class_hierarchy,
630    'BROW' : class_browser,
631    'COMP' : file_compare_document,
632    'CTLG' : catalog_document,
633    'EDIT' : editor_document,
634    'HIER' : class_hierarchy,
635    'INSP' : project_inspector,
636    'MSSG' : message_document,
637    'PRGS' : build_progress_document,
638    'PRJD' : project_document,
639    'SBTG' : subtarget,
640    'SRCF' : target_file,
641    'SYMB' : symbol_browser,
642    'TOOL' : ToolServer_worksheet,
643    'TRGT' : target,
644    'TXTD' : text_document,
645}
646
647_propdeclarations = {
648    'CMPD' : _Prop_compiled_date,
649    'CSZE' : _Prop_code_size,
650    'CURT' : _Prop_current_target,
651    'DBUG' : _Prop_debug,
652    'DPND' : _Prop_dependents,
653    'DSZE' : _Prop_data_size,
654    'FILE' : _Prop_location,
655    'FTYP' : _Prop_type,
656    'ID  ' : _Prop_id,
657    'INIT' : _Prop_init_before,
658    'LIDX' : _Prop_link_index,
659    'LINK' : _Prop_linked,
660    'LNKO' : _Prop_link_against_output,
661    'MODD' : _Prop_modified_date,
662    'MRGE' : _Prop_merge_output,
663    'PRER' : _Prop_prerequisites,
664    'Path' : _Prop_path,
665    'PrjD' : _Prop_project_document,
666    'TrgT' : _Prop_target,
667    'WEAK' : _Prop_weak_link,
668    'c@#^' : _Prop_inherits,
669    'imod' : _Prop_modified,
670    'pnam' : _Prop_name,
671    'sele' : _Prop_selection,
672}
673
674_compdeclarations = {
675}
676
677_enumdeclarations = {
678    'DKND' : _Enum_DKND,
679    'FTYP' : _Enum_FTYP,
680    'Inte' : _Enum_Inte,
681    'PERM' : _Enum_PERM,
682}