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
0110dfc5
Commit
0110dfc5
authored
Jan 27, 2016
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Plain Diff
Merge with 3.5
parents
5b96f17b
b31a2849
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
Lib/idlelib/IOBinding.py
Lib/idlelib/IOBinding.py
+10
-1
Lib/idlelib/idle_test/htest.py
Lib/idlelib/idle_test/htest.py
+3
-0
No files found.
Lib/idlelib/IOBinding.py
View file @
0110dfc5
...
...
@@ -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
(
"<Control-o>"
,
self
.
open
)
self
.
text
.
bind
(
'<Control-p>'
,
self
.
print
)
self
.
text
.
bind
(
"<Control-s>"
,
self
.
save
)
self
.
text
.
bind
(
"<Alt-s>"
,
self
.
saveas
)
self
.
text
.
bind
(
'<Control-c>'
,
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
(
"<<open-window-from-file>>"
)
def
print
(
self
,
event
):
self
.
text
.
event_generate
(
"<<print-window>>"
)
def
save
(
self
,
event
):
self
.
text
.
event_generate
(
"<<save-window>>"
)
def
saveas
(
self
,
event
):
self
.
text
.
event_generate
(
"<<save-window-as-file>>"
)
def
savecopy
(
self
,
event
):
self
.
text
.
event_generate
(
"<<save-copy-of-window-as-file>>"
)
text
=
Text
(
root
)
text
.
pack
()
...
...
Lib/idlelib/idle_test/htest.py
View file @
0110dfc5
...
...
@@ -192,7 +192,10 @@ _io_binding_spec = {
'msg'
:
"Test the following bindings.
\
n
"
"<Control-o> to open file from dialog.
\
n
"
"Edit the file.
\
n
"
"<Control-p> to print the file.
\
n
"
"<Control-s> to save the file.
\
n
"
"<Alt-s> to save-as another file.
\
n
"
"<Control-c> to save-copy-as another file.
\
n
"
"Check that changes were saved by opening the file elsewhere."
}
...
...
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