mirror of
https://github.com/python/cpython.git
synced 2025-09-14 12:46:49 +00:00
Getting rid of StandardGetFile
This commit is contained in:
parent
96bf0d75e2
commit
d44a3ec63c
3 changed files with 13 additions and 17 deletions
|
@ -35,18 +35,18 @@ def buildapplet():
|
|||
# Ask for source text if not specified in sys.argv[1:]
|
||||
|
||||
if not sys.argv[1:]:
|
||||
srcfss, ok = macfs.PromptGetFile('Select Python source or applet:', 'TEXT', 'APPL')
|
||||
if not ok:
|
||||
filename = EasyDialogs.AskFileForOpen(message='Select Python source or applet:',
|
||||
fileTypes=('TEXT', 'APPL'))
|
||||
if not filename:
|
||||
return
|
||||
filename = srcfss.as_pathname()
|
||||
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
|
||||
dstfilename = dstfss.as_pathname()
|
||||
dstfilename = EasyDialogs.AskFileForSave(message='Save application as:',
|
||||
savedFileName=tf)
|
||||
if not dstfilename: return
|
||||
cr, tp = MacOS.GetCreatorAndType(filename)
|
||||
if tp == 'APPL':
|
||||
buildtools.update(template, filename, dstfilename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue