summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/IOBinding.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2015-10-30 06:47:01 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2015-10-30 06:47:01 (GMT)
commitfaaf16b8ed273bb974ea18183ef17f078e0d3944 (patch)
tree5e06a6dde05ee79daa946e470d6029063fbe1c41 /Lib/idlelib/IOBinding.py
parenta05c41302983fff42c4fd0e0119cdeb27d0c18b6 (diff)
downloadcpython-faaf16b8ed273bb974ea18183ef17f078e0d3944.zip
cpython-faaf16b8ed273bb974ea18183ef17f078e0d3944.tar.gz
cpython-faaf16b8ed273bb974ea18183ef17f078e0d3944.tar.bz2
Issue #25507: move test-specific imports to test function (idlelib.IOBinding).
Diffstat (limited to 'Lib/idlelib/IOBinding.py')
-rw-r--r--Lib/idlelib/IOBinding.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index 7c80bc5..3b39606 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -5,21 +5,18 @@
# end-of-line conventions, instead of relying on the standard library,
# which will only understand the local convention.
+import codecs
+from codecs import BOM_UTF8
import os
import pipes
+import re
import sys
-import codecs
import tempfile
+
import tkFileDialog
import tkMessageBox
-import re
-from Tkinter import *
from SimpleDialog import SimpleDialog
-from idlelib.configHandler import idleConf
-
-from codecs import BOM_UTF8
-
# Try setting the locale, so that we can find out
# what encoding to use
try:
@@ -567,8 +564,12 @@ class IOBinding:
"Update recent file list on all editor windows"
self.editwin.update_recent_files_list(filename)
+
def _io_binding(parent): # htest #
- root = Tk()
+ from Tkinter import Toplevel, Text
+ from idlelib.configHandler import idleConf
+
+ root = Toplevel(parent)
root.title("Test IOBinding")
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
root.geometry("+%d+%d"%(x, y + 150))
@@ -585,6 +586,7 @@ def _io_binding(parent): # htest #
self.text.event_generate("<<open-window-from-file>>")
def save(self, event):
self.text.event_generate("<<save-window>>")
+ def update_recent_files_list(s, f): pass
text = Text(root)
text.pack()