diff --git a/Mac/Lib/buildtools.py b/Mac/Lib/buildtools.py index 2a8fd03cfb2..dd2e30e3bfa 100644 --- a/Mac/Lib/buildtools.py +++ b/Mac/Lib/buildtools.py @@ -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):