diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1995-02-27 16:19:07 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1995-02-27 16:19:07 (GMT) |
commit | 2120d12265ee5d5e824179c796e2fb2229906e0b (patch) | |
tree | f1deab6d07bf371edc7773ad6c40737a38cc13df | |
parent | 16df2aa57b32efa890d83f9c7f34c27d8c2cc742 (diff) | |
download | cpython-2120d12265ee5d5e824179c796e2fb2229906e0b.zip cpython-2120d12265ee5d5e824179c796e2fb2229906e0b.tar.gz cpython-2120d12265ee5d5e824179c796e2fb2229906e0b.tar.bz2 |
In interactive mode ask for output file
-rw-r--r-- | Mac/mkapplet.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Mac/mkapplet.py b/Mac/mkapplet.py index 6f9f111..99486d4 100644 --- a/Mac/mkapplet.py +++ b/Mac/mkapplet.py @@ -58,17 +58,23 @@ def main(): if not ok: return filename = srcfss.as_pathname() - if not sys.argv: sys.argv.append('') - sys.argv.append(filename) - - # Loop over all files to be processed - - for filename in sys.argv[1:]: - process(template, filename) + tp, tf = os.path.split(filename) + if tf[-3:] == '.py': + tf = tf[:-3] + else: + tf = tf + '.applet' + dstfss, ok = macfs.StandardPutFile('Save application as:', tf) + if not ok: return + process(template, filename, dstfss.as_pathname()) + else: + + # Loop over all files to be processed + for filename in sys.argv[1:]: + process(template, filename, '') undefs = ('????', ' ', '\0\0\0\0', 'BINA') -def process(template, filename): +def process(template, filename, output): print "Processing", `filename`, "..." @@ -93,6 +99,8 @@ def process(template, filename): destname = filename + ".applet" rsrcname = filename + '.rsrc' + if output: + destname = output # Copy the data from the template (creating the file as well) tmpl = open(template, "rb") |