mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Recognize {compiler} and {project} prefixes to pathnames and output the correct XML.
This commit is contained in:
parent
7b3cc1f9c3
commit
4a4adf4293
1 changed files with 10 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
# First attempt at automatically generating CodeWarior projects
|
# First attempt at automatically generating CodeWarior projects
|
||||||
import os
|
import os
|
||||||
import MacOS
|
import MacOS
|
||||||
|
import string
|
||||||
|
|
||||||
Error="gencwproject.Error"
|
Error="gencwproject.Error"
|
||||||
#
|
#
|
||||||
|
@ -55,7 +56,15 @@ class ProjectBuilder:
|
||||||
if not type(keyvalues) in (type(()), type([])):
|
if not type(keyvalues) in (type(()), type([])):
|
||||||
raise Error, "List or tuple expected for %s"%key
|
raise Error, "List or tuple expected for %s"%key
|
||||||
for curkeyvalue in keyvalues:
|
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'
|
self.dict['pathtype'] = 'Absolute'
|
||||||
else:
|
else:
|
||||||
self.dict['pathtype'] = 'Project'
|
self.dict['pathtype'] = 'Project'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue