]> granicus.if.org Git - python/commitdiff
Recognize {compiler} and {project} prefixes to pathnames and output the correct XML.
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 24 Jan 2001 16:04:50 +0000 (16:04 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 24 Jan 2001 16:04:50 +0000 (16:04 +0000)
Mac/Lib/mkcwproject/cwxmlgen.py

index c3218a37c05776cb828abd3688bc2d6d12ee45f9..ef6f93a63d43c98dfc6d5913919a6845b362288a 100644 (file)
@@ -1,6 +1,7 @@
 # First attempt at automatically generating CodeWarior projects
 import os
 import MacOS
+import string
 
 Error="gencwproject.Error"
 #
@@ -55,7 +56,15 @@ class ProjectBuilder:
                                        if not type(keyvalues) in (type(()), type([])):
                                                raise Error, "List or tuple expected for %s"%key
                                        for curkeyvalue in keyvalues:
-                                               if os.path.isabs(curkeyvalue):
+                                               if string.lower(curkeyvalue[:10]) == '{compiler}':
+                                                       curkeyvalue = curkeyvalue[10:]
+                                                       self.dict['pathtype'] = 'CodeWarrior'
+                                               elif string.lower(curkeyvalue[:9]) == '{project}':
+                                                       curkeyvalue = curkeyvalue[9:]
+                                                       self.dict['pathtype'] = 'Project'
+                                               elif curkeyvalue[0] == '{':
+                                                       raise Error, "Unknown {} escape in %s"%curkeyvalue
+                                               elif os.path.isabs(curkeyvalue):
                                                        self.dict['pathtype'] = 'Absolute'
                                                else:
                                                        self.dict['pathtype'] = 'Project'