mirror of https://github.com/python/cpython.git
Allow selecting a template in findtemplate(), so Classic programs can build Carbon applets and vice-versa.
This commit is contained in:
parent
881cd36853
commit
a4f8e58058
|
@ -40,19 +40,21 @@
|
|||
WRITE = 2
|
||||
|
||||
|
||||
def findtemplate():
|
||||
def findtemplate(template=None):
|
||||
"""Locate the applet template along sys.path"""
|
||||
if not template:
|
||||
template=TEMPLATE
|
||||
for p in sys.path:
|
||||
template = os.path.join(p, TEMPLATE)
|
||||
file = os.path.join(p, template)
|
||||
try:
|
||||
template, d1, d2 = macfs.ResolveAliasFile(template)
|
||||
file, d1, d2 = macfs.ResolveAliasFile(file)
|
||||
break
|
||||
except (macfs.error, ValueError):
|
||||
continue
|
||||
else:
|
||||
raise BuildError, "Template %s not found on sys.path" % `TEMPLATE`
|
||||
template = template.as_pathname()
|
||||
return template
|
||||
raise BuildError, "Template %s not found on sys.path" % `template`
|
||||
file = file.as_pathname()
|
||||
return file
|
||||
|
||||
|
||||
def process(template, filename, output, copy_codefragment):
|
||||
|
|
Loading…
Reference in New Issue