Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
faaf16b8
Commit
faaf16b8
authored
Oct 30, 2015
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #25507: move test-specific imports to test function (idlelib.IOBinding).
parent
a05c4130
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
Lib/idlelib/IOBinding.py
Lib/idlelib/IOBinding.py
+10
-8
Lib/idlelib/idle_test/htest.py
Lib/idlelib/idle_test/htest.py
+5
-3
No files found.
Lib/idlelib/IOBinding.py
View file @
faaf16b8
...
...
@@ -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
()
...
...
Lib/idlelib/idle_test/htest.py
View file @
faaf16b8
...
...
@@ -189,9 +189,11 @@ _grep_dialog_spec = {
_io_binding_spec
=
{
'file'
:
'IOBinding'
,
'kwds'
:
{},
'msg'
:
"Test the following bindings
\
n
"
"<Control-o> to display open window from file dialog.
\
n
"
"<Control-s> to save the file
\
n
"
'msg'
:
"Test the following bindings.
\
n
"
"<Control-o> to open file from dialog.
\
n
"
"Edit the file.
\
n
"
"<Control-s> to save the file.
\
n
"
"Check that changes were saved by opening the file elsewhere."
}
_multi_call_spec
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment