mirror of https://github.com/python/cpython
mkcwproject now works, but for one thing: the import of the XML document as a project through AppleEvents.
This commit is contained in:
parent
9a8df7db6b
commit
4a751580ca
|
@ -1,5 +1,8 @@
|
|||
import cwxmlgen
|
||||
import cwtalker
|
||||
import os
|
||||
import AppleEvents
|
||||
import macfs
|
||||
|
||||
def mkproject(outputfile, modulename, settings):
|
||||
#
|
||||
|
@ -16,7 +19,7 @@ def mkproject(outputfile, modulename, settings):
|
|||
dictcopy['mac_outputdir'] = ':lib:' # XXX Is this correct??
|
||||
dictcopy['mac_dllname'] = modulename + '.ppc.slb'
|
||||
dictcopy['mac_targetname'] = modulename + '.ppc'
|
||||
of os.path.isabs(dictcopy['sysprefix']):
|
||||
if os.path.isabs(dictcopy['sysprefix']):
|
||||
dictcopy['mac_sysprefixtype'] = 'Absolute'
|
||||
else:
|
||||
dictcopy['mac_sysprefixtype'] = 'Project' # XXX not sure this is right...
|
||||
|
@ -26,7 +29,7 @@ def mkproject(outputfile, modulename, settings):
|
|||
xmlbuilder = cwxmlgen.ProjectBuilder(dictcopy)
|
||||
xmlbuilder.generate()
|
||||
fp = open(dictcopy['mac_projectxmlname'], "w")
|
||||
fp.write(dict["tmp_projectxmldata"])
|
||||
fp.write(dictcopy["tmp_projectxmldata"])
|
||||
fp.close()
|
||||
#
|
||||
# Generate the export file
|
||||
|
@ -39,8 +42,11 @@ def mkproject(outputfile, modulename, settings):
|
|||
#
|
||||
cw = cwtalker.MyCodeWarrior(start=1)
|
||||
cw.send_timeout = AppleEvents.kNoTimeOut
|
||||
xmlfss = macfs.FSSpec(dictcopy['mac_projectxmlname'])
|
||||
prjfss = macfs.FSSpec(outputfile)
|
||||
## xmlfss = macfs.FSSpec(dictcopy['mac_projectxmlname'])
|
||||
## prjfss = macfs.FSSpec(outputfile)
|
||||
xmlfss = dictcopy['mac_projectxmlname']
|
||||
prjfss = outputfile
|
||||
cw.activate()
|
||||
cw.my_mkproject(prjfss, xmlfss)
|
||||
|
||||
def buildproject(projectfile):
|
||||
|
|
|
@ -23,4 +23,4 @@ class MyCodeWarrior(CodeWarrior.CodeWarrior):
|
|||
return _arguments['----']
|
||||
|
||||
def my_mkproject(self, prjfile, xmlfile):
|
||||
self.make(new=CodeWarrior.project_document, with_data=xmlfile, at=prjfile)
|
||||
self.make(new=CodeWarrior.project_document(), with_data=xmlfile, as=prjfile)
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
</SETTING>
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>%(sysprefix)s:Mac:</VALUE></SETTING>
|
||||
<SETTING><NAME>Path</NAME><VALUE>%(sysprefix)sMac:</VALUE></SETTING>
|
||||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>%(mac_sysprefixtype)s</VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
@ -113,7 +113,7 @@
|
|||
%(tmp_extrasearchdirs)s
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>%(sysprefix)s::GUSI2:include:</VALUE></SETTING>
|
||||
<SETTING><NAME>Path</NAME><VALUE>%(sysprefix)s:GUSI2:include:</VALUE></SETTING>
|
||||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>%(mac_sysprefixtype)s</VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import mkcwproj
|
||||
import mkcwproject
|
||||
import sys
|
||||
|
||||
dict = {
|
||||
|
@ -8,5 +8,5 @@ dict = {
|
|||
}
|
||||
|
||||
|
||||
mkcwproj.mkproject("mkcwtest.prj", "mkcwtest", dict)
|
||||
mkcwproj.buildproject("mkcwtest.prj")
|
||||
mkcwproject.mkproject("mkcwtest.prj", "mkcwtest", dict)
|
||||
mkcwproject.buildproject("mkcwtest.prj")
|
||||
|
|
Loading…
Reference in New Issue