From b31a2849dac463719675e31087a2c3216737529d Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 27 Jan 2016 11:51:50 -0500 Subject: Issue #25507: revert incorrect movement of idleConf import in c548ad75160c. Augment htest to include all major IOBinding functions. --- Lib/idlelib/IOBinding.py | 11 ++++++++++- Lib/idlelib/idle_test/htest.py | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index 5ec9d54..a4cc205 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -10,6 +10,7 @@ import tkinter.filedialog as tkFileDialog import tkinter.messagebox as tkMessageBox from tkinter.simpledialog import askstring +from idlelib.configHandler import idleConf # Try setting the locale, so that we can find out @@ -525,7 +526,6 @@ class IOBinding: def _io_binding(parent): # htest # from tkinter import Toplevel, Text - from idlelib.configHandler import idleConf root = Toplevel(parent) root.title("Test IOBinding") @@ -536,14 +536,23 @@ def _io_binding(parent): # htest # self.text = text self.flist = None self.text.bind("", self.open) + self.text.bind('', self.print) self.text.bind("", self.save) + self.text.bind("", self.saveas) + self.text.bind('', self.savecopy) def get_saved(self): return 0 def set_saved(self, flag): pass def reset_undo(self): pass def open(self, event): self.text.event_generate("<>") + def print(self, event): + self.text.event_generate("<>") def save(self, event): self.text.event_generate("<>") + def saveas(self, event): + self.text.event_generate("<>") + def savecopy(self, event): + self.text.event_generate("<>") text = Text(root) text.pack() diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py index 3e24518..58e62cb 100644 --- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -192,7 +192,10 @@ _io_binding_spec = { 'msg': "Test the following bindings.\n" " to open file from dialog.\n" "Edit the file.\n" + " to print the file.\n" " to save the file.\n" + " to save-as another file.\n" + " to save-copy-as another file.\n" "Check that changes were saved by opening the file elsewhere." } -- cgit v0.12