diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-01-22 14:03:12 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-01-22 14:03:12 (GMT) |
commit | d44a3ec63c5d3608c3dc88fbc5f63dd6a96303d6 (patch) | |
tree | 5df18e2744ece8c6f289b49d409f5e0ddd3a1d97 | |
parent | 96bf0d75e27fa4f221b2d670f545a63cd903a726 (diff) | |
download | cpython-d44a3ec63c5d3608c3dc88fbc5f63dd6a96303d6.zip cpython-d44a3ec63c5d3608c3dc88fbc5f63dd6a96303d6.tar.gz cpython-d44a3ec63c5d3608c3dc88fbc5f63dd6a96303d6.tar.bz2 |
Getting rid of StandardGetFile
-rw-r--r-- | Mac/scripts/BuildApplet.py | 12 | ||||
-rw-r--r-- | Mac/scripts/BuildApplication.py | 11 | ||||
-rw-r--r-- | Mac/scripts/MkDistr_ui.py | 7 |
3 files changed, 13 insertions, 17 deletions
diff --git a/Mac/scripts/BuildApplet.py b/Mac/scripts/BuildApplet.py index 9e68279..3134650 100644 --- a/Mac/scripts/BuildApplet.py +++ b/Mac/scripts/BuildApplet.py @@ -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) diff --git a/Mac/scripts/BuildApplication.py b/Mac/scripts/BuildApplication.py index a7c8f40..c919b3f 100644 --- a/Mac/scripts/BuildApplication.py +++ b/Mac/scripts/BuildApplication.py @@ -12,7 +12,6 @@ import sys import string import os -import macfs import MacOS from Carbon import Res from Carbon import Dlg @@ -54,10 +53,10 @@ def buildapplication(debug = 0): # Ask for source text if not specified in sys.argv[1:] if not sys.argv[1:]: - srcfss, ok = macfs.PromptGetFile('Select Python source:', 'TEXT') - if not ok: + filename = EasyDialogs.AskFileForOpen(message='Select Python source:', + fileTypes=('TEXT',)) + if not filename: return - filename = srcfss.as_pathname() else: if sys.argv[2:]: raise buildtools.BuildError, "please select one file at a time" @@ -73,10 +72,10 @@ def buildapplication(debug = 0): else: tf = tf + '.app' - dstfss, ok = macfs.StandardPutFile('Save application as:', tf) + dstfilename = EasyDialogs.AskFileForSate(message='Save application as:', + savedFileName=tf) if not ok: return - dstfilename = dstfss.as_pathname() macgen_bin.generate(filename, dstfilename, None, architecture, 1) diff --git a/Mac/scripts/MkDistr_ui.py b/Mac/scripts/MkDistr_ui.py index 5386950..ee7ace0 100644 --- a/Mac/scripts/MkDistr_ui.py +++ b/Mac/scripts/MkDistr_ui.py @@ -20,7 +20,6 @@ from Carbon import Win from Carbon import Qd from FrameWork import * import EasyDialogs -import macfs import os import sys import macresource @@ -304,11 +303,9 @@ def GetType(): if rv == DTYPE_CANCEL: sys.exit(0) if rv == DTYPE_EXIST: -## macfs.SetFolder(':(MkDistr)') - fss, ok = macfs.StandardGetFile('TEXT') - if not ok: + path = EasyDialogs.AskFileForOpen() + if not path: sys.exit(0) - path = fss.as_pathname() basename = os.path.split(path)[-1] if basename[-8:] <> '.include': EasyDialogs.Message('That is not a distribution include file') |