diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-02-17 23:30:19 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-02-17 23:30:19 (GMT) |
commit | a4f8e580588b7ebd5fde61debab3fdb72f37cdec (patch) | |
tree | 0146b3343a9397cdcf0ca55540ed9526a3c5d368 | |
parent | 881cd36853ddb077c3c3afb83416be587cf959af (diff) | |
download | cpython-a4f8e580588b7ebd5fde61debab3fdb72f37cdec.zip cpython-a4f8e580588b7ebd5fde61debab3fdb72f37cdec.tar.gz cpython-a4f8e580588b7ebd5fde61debab3fdb72f37cdec.tar.bz2 |
Allow selecting a template in findtemplate(), so Classic programs can build Carbon applets and vice-versa.
-rw-r--r-- | Mac/Lib/buildtools.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Mac/Lib/buildtools.py b/Mac/Lib/buildtools.py index 2a8fd03..dd2e30e 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): |