From a4f8e580588b7ebd5fde61debab3fdb72f37cdec Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sat, 17 Feb 2001 23:30:19 +0000 Subject: [PATCH] Allow selecting a template in findtemplate(), so Classic programs can build Carbon applets and vice-versa. --- Mac/Lib/buildtools.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 @@ READ = 1 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):