Updated for hfsplus module, new gusi libs.
[python/dscho.git] / Mac / Lib / mkcwproject / cwtalker.py
blob650fd43f4b9aed32d4e54309764345849e03f8c4
1 import CodeWarrior
2 import aetools
3 import aetypes
5 # There is both a class "project document" and a property "project document".
6 # We want the class, but the property overrides it.
8 ##class project_document(aetools.ComponentItem):
9 ## """project document - a project document """
10 ## want = 'PRJD'
11 project_document=aetypes.Type('PRJD')
13 class MyCodeWarrior(CodeWarrior.CodeWarrior):
14 # Bug in the CW OSA dictionary
15 def export(self, object, _attributes={}, **_arguments):
16 """export: Export the project file as an XML file
17 Keyword argument _in: the XML file in which to export the project
18 Keyword argument _attributes: AppleEvent attribute dictionary
19 """
20 _code = 'CWIE'
21 _subcode = 'EXPT'
23 aetools.keysubst(_arguments, self._argmap_export)
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 def my_mkproject(self, prjfile, xmlfile):
36 self.make(new=project_document, with_data=xmlfile, as=prjfile)