diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-01-26 22:15:48 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-01-26 22:15:48 (GMT) |
commit | fd0b00e0a7c11e3ba5743cfc82b7e9ef099453c7 (patch) | |
tree | 36784415dde6ba18950ed49bf94b3b2ca6eff71e /Mac/Tools/IDE/PyConsole.py | |
parent | 2373ff4e4ffbcd35112e13528b162ee80e4786cc (diff) | |
download | cpython-fd0b00e0a7c11e3ba5743cfc82b7e9ef099453c7.zip cpython-fd0b00e0a7c11e3ba5743cfc82b7e9ef099453c7.tar.gz cpython-fd0b00e0a7c11e3ba5743cfc82b7e9ef099453c7.tar.bz2 |
Use new file dialogs.
Diffstat (limited to 'Mac/Tools/IDE/PyConsole.py')
-rw-r--r-- | Mac/Tools/IDE/PyConsole.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Mac/Tools/IDE/PyConsole.py b/Mac/Tools/IDE/PyConsole.py index 3fae413..27fc0cd 100644 --- a/Mac/Tools/IDE/PyConsole.py +++ b/Mac/Tools/IDE/PyConsole.py @@ -10,6 +10,7 @@ import traceback import MacOS import MacPrefs from Carbon import Qd +import EasyDialogs import PyInteractive if not hasattr(sys, 'ps1'): @@ -85,10 +86,11 @@ class ConsoleTextWidget(W.EditText): def domenu_save_as(self, *args): import macfs - fss, ok = macfs.StandardPutFile('Save console text as:', 'console.txt') - if not ok: + filename = EasyDialogs.AskFileForSave(message='Save console text as:', + savedFileName='console.txt') + if not filename: return - f = open(fss.as_pathname(), 'wb') + f = open(filename, 'wb') f.write(self.get()) f.close() fss.SetCreatorType(W._signature, 'TEXT') @@ -241,10 +243,11 @@ class OutputTextWidget(W.EditText): def domenu_save_as(self, *args): title = self._parentwindow.gettitle() import macfs - fss, ok = macfs.StandardPutFile('Save %s text as:' % title, title + '.txt') - if not ok: + filename = EasyDialogs.AskFileForSave(message='Save %s text as:' % title, + savedFileName=title + '.txt') + if not filename: return - f = open(fss.as_pathname(), 'wb') + f = open(filename, 'wb') f.write(self.get()) f.close() fss.SetCreatorType(W._signature, 'TEXT') |