Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a4adf4

Browse files
committed
Recognize {compiler} and {project} prefixes to pathnames and output the correct XML.
1 parent 7b3cc1f commit 4a4adf4

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

Mac/Lib/mkcwproject/cwxmlgen.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# First attempt at automatically generating CodeWarior projects
22
import os
33
import MacOS
4+
import string
45

56
Error="gencwproject.Error"
67
#
@@ -55,7 +56,15 @@ def _generate_one_template(self, tmpl):
5556
if not type(keyvalues) in (type(()), type([])):
5657
raise Error, "List or tuple expected for %s"%key
5758
for curkeyvalue in keyvalues:
58-
if os.path.isabs(curkeyvalue):
59+
if string.lower(curkeyvalue[:10]) == '{compiler}':
60+
curkeyvalue = curkeyvalue[10:]
61+
self.dict['pathtype'] = 'CodeWarrior'
62+
elif string.lower(curkeyvalue[:9]) == '{project}':
63+
curkeyvalue = curkeyvalue[9:]
64+
self.dict['pathtype'] = 'Project'
65+
elif curkeyvalue[0] == '{':
66+
raise Error, "Unknown {} escape in %s"%curkeyvalue
67+
elif os.path.isabs(curkeyvalue):
5968
self.dict['pathtype'] = 'Absolute'
6069
else:
6170
self.dict['pathtype'] = 'Project'

0 commit comments

Comments
 (0)