summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/IOBinding.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/IOBinding.py')
-rw-r--r--Lib/idlelib/IOBinding.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index deeb5c5..cbc1c33 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -16,7 +16,7 @@ import re
from Tkinter import *
from SimpleDialog import SimpleDialog
-from configHandler import idleConf
+from idlelib.configHandler import idleConf
try:
from codecs import BOM_UTF8
@@ -209,7 +209,7 @@ class IOBinding:
# gets set to "not modified" at every new prompt.
try:
interp = self.editwin.interp
- except:
+ except AttributeError:
interp = None
if not self.filename and self.get_saved() and not interp:
self.editwin.flist.open(filename, self.loadfile)
@@ -465,13 +465,23 @@ class IOBinding:
self.text.insert("end-1c", "\n")
def print_window(self, event):
+ m = tkMessageBox.Message(
+ title="Print",
+ message="Print to Default Printer",
+ icon=tkMessageBox.QUESTION,
+ type=tkMessageBox.OKCANCEL,
+ default=tkMessageBox.OK,
+ master=self.text)
+ reply = m.show()
+ if reply != tkMessageBox.OK:
+ self.text.focus_set()
+ return "break"
tempfilename = None
saved = self.get_saved()
if saved:
filename = self.filename
# shell undo is reset after every prompt, looks saved, probably isn't
if not saved or filename is None:
- # XXX KBK 08Jun03 Wouldn't it be better to ask the user to save?
(tfd, tempfilename) = tempfile.mkstemp(prefix='IDLE_tmp_')
filename = tempfilename
os.close(tfd)