File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# First attempt at automatically generating CodeWarior projects
22import os
33import MacOS
4+ import string
45
56Error = "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'
You can’t perform that action at this time.
0 commit comments