summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-01-23 22:34:50 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-01-23 22:34:50 (GMT)
commit50f6f6f621268c4fd0cb86c1e3df0b8c190fde9e (patch)
tree7b9cd4cac18212276a50abe07e034f26d66fa5ab /Mac
parent6ecf14639d74671a6a5c12f17fe4c6a125ecc6e2 (diff)
downloadcpython-50f6f6f621268c4fd0cb86c1e3df0b8c190fde9e.zip
cpython-50f6f6f621268c4fd0cb86c1e3df0b8c190fde9e.tar.gz
cpython-50f6f6f621268c4fd0cb86c1e3df0b8c190fde9e.tar.bz2
If the template is not specified it depends on the current execution model (classic ppc or carbon).
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Lib/mkcwproject/cwxmlgen.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/Mac/Lib/mkcwproject/cwxmlgen.py b/Mac/Lib/mkcwproject/cwxmlgen.py
index 959516f..c3218a3 100644
--- a/Mac/Lib/mkcwproject/cwxmlgen.py
+++ b/Mac/Lib/mkcwproject/cwxmlgen.py
@@ -1,5 +1,6 @@
# First attempt at automatically generating CodeWarior projects
import os
+import MacOS
Error="gencwproject.Error"
#
@@ -17,15 +18,22 @@ TEMPLATELIST= [
]
class ProjectBuilder:
- def __init__(self, dict, templatelist=TEMPLATELIST, templatedir=None):
- if templatedir == None:
+ def __init__(self, dict, templatelist=TEMPLATELIST, templatename=None):
+ if templatename == None:
+ if hasattr(MacOS, 'runtimemodel'):
+ templatename = 'template-%s'%MacOS.runtimemodel
+ else:
+ templatename = 'template'
+ if os.sep in templatename:
+ templatedir = templatename
+ else:
try:
packagedir = os.path.split(__file__)[0]
except NameError:
packagedir = os.curdir
- templatedir = os.path.join(packagedir, 'template')
+ templatedir = os.path.join(packagedir, templatename)
if not os.path.exists(templatedir):
- raise Error, "Cannot file templatedir"
+ raise Error, "Cannot find templatedir %s"%templatedir
self.dict = dict
if not dict.has_key('prefixname'):
dict['prefixname'] = 'mwerks_plugin_config.h'