blob: 650fd43f4b9aed32d4e54309764345849e03f8c4 [file] [log] [blame]
Jack Jansen07642c32000-09-22 23:26:55 +00001import CodeWarrior
Jack Jansen486f1382000-09-24 21:56:43 +00002import aetools
3import aetypes
4
5# There is both a class "project document" and a property "project document".
6# We want the class, but the property overrides it.
7#
8##class project_document(aetools.ComponentItem):
9## """project document - a project document """
10## want = 'PRJD'
11project_document=aetypes.Type('PRJD')
Jack Jansen07642c32000-09-22 23:26:55 +000012
13class 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'
22
23 aetools.keysubst(_arguments, self._argmap_export)
24 _arguments['----'] = _object
25
26
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['----']
34
35 def my_mkproject(self, prjfile, xmlfile):
Jack Jansen486f1382000-09-24 21:56:43 +000036 self.make(new=project_document, with_data=xmlfile, as=prjfile)