]> granicus.if.org Git - python/commitdiff
mkcwproject now works, but for one thing: the import of the XML document as a projec...
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 22 Sep 2000 23:54:07 +0000 (23:54 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 22 Sep 2000 23:54:07 +0000 (23:54 +0000)
Mac/Lib/mkcwproject/__init__.py
Mac/Lib/mkcwproject/cwtalker.py
Mac/Lib/mkcwproject/template/template.prj.xml
Mac/Lib/test/mkcwproj/testmkcwproj.py

index 9664542a1cede0080572a354a982273029963b77..8bd3a8d4a2f9935a26ee7a599ed29d27fa70e284 100644 (file)
@@ -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):
index fbce6205a1115fee675caf301322abd2c0d391fc..3b2d3b42f7bcab0547386bccc1d96bca90d6c28b 100644 (file)
@@ -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)
index ac38544f1ef54dc90ec2a9e65ef316d51172ef7b..86423430075d305bee0c52111fc611aa395c21fc 100644 (file)
@@ -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>
                     %(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>
index 4c46e96fdf0a797bb15e37ea2aaaf0db29142779..ac1cb8ec762ecaf6a23925c8a02222c90a35d512 100644 (file)
@@ -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")