mirror of https://github.com/python/cpython
In interactive mode ask for output file
This commit is contained in:
parent
16df2aa57b
commit
2120d12265
|
@ -58,17 +58,23 @@ def main():
|
||||||
if not ok:
|
if not ok:
|
||||||
return
|
return
|
||||||
filename = srcfss.as_pathname()
|
filename = srcfss.as_pathname()
|
||||||
if not sys.argv: sys.argv.append('')
|
tp, tf = os.path.split(filename)
|
||||||
sys.argv.append(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
|
# Loop over all files to be processed
|
||||||
|
|
||||||
for filename in sys.argv[1:]:
|
for filename in sys.argv[1:]:
|
||||||
process(template, filename)
|
process(template, filename, '')
|
||||||
|
|
||||||
undefs = ('????', ' ', '\0\0\0\0', 'BINA')
|
undefs = ('????', ' ', '\0\0\0\0', 'BINA')
|
||||||
|
|
||||||
def process(template, filename):
|
def process(template, filename, output):
|
||||||
|
|
||||||
print "Processing", `filename`, "..."
|
print "Processing", `filename`, "..."
|
||||||
|
|
||||||
|
@ -93,6 +99,8 @@ def process(template, filename):
|
||||||
destname = filename + ".applet"
|
destname = filename + ".applet"
|
||||||
rsrcname = filename + '.rsrc'
|
rsrcname = filename + '.rsrc'
|
||||||
|
|
||||||
|
if output:
|
||||||
|
destname = output
|
||||||
# Copy the data from the template (creating the file as well)
|
# Copy the data from the template (creating the file as well)
|
||||||
|
|
||||||
tmpl = open(template, "rb")
|
tmpl = open(template, "rb")
|
||||||
|
|
Loading…
Reference in New Issue