Mercurial > cpython-lru_cache-weakref
diff Mac/Tools/IDE/PyConsole.py @ 27408:ea5ee3e7bfb1 legacy-trunk
Use new file dialogs.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Sun, 26 Jan 2003 22:15:48 +0000 |
| parents | 9220098f0327 |
| children | 4367f805db09 |
line wrap: on
line diff
--- a/Mac/Tools/IDE/PyConsole.py Sun Jan 26 22:15:10 2003 +0000 +++ b/Mac/Tools/IDE/PyConsole.py Sun Jan 26 22:15:48 2003 +0000 @@ -10,6 +10,7 @@ import MacOS import MacPrefs from Carbon import Qd +import EasyDialogs import PyInteractive if not hasattr(sys, 'ps1'): @@ -85,10 +86,11 @@ 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 @@ 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')
