Commit 4cc5ef5d authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

M Bindings.py

M PyShell.py
M config-keys.def
M configHandler.py

1. Clear any un-entered characters from input line before printing the
   restart boundary.
2. Restore the Debug menu: There are now both Shell and Debug menus.
3. Add Control-F6 keybinding to Restart Shell.
4. Clarify PyShell.cancel_check() comment.
5. Update doc string for Bindings.py and re-format the file slightly.
parent 374c4357
# This file defines the menu contents and key bindings. Note that """Define the menu contents, hotkeys, and event bindings.
# there is additional configuration information in the EditorWindow
# class (and subclasses): the menus are created there based on the
# menu_specs (class) variable, and menus not created are silently
# skipped by the code here. This makes it possible to define the
# Debug menu here, which is only present in the PythonShell window.
There is additional configuration information in the EditorWindow class (and
subclasses): the menus are created there based on the menu_specs (class)
variable, and menus not created are silently skipped in the code here. This
makes it possible, for example, to define a Debug menu which is only present in
the PythonShell window, and a Format menu which is only present in the Editor
windows.
"""
import sys import sys
from configHandler import idleConf from configHandler import idleConf
...@@ -43,39 +46,40 @@ menudefs = [ ...@@ -43,39 +46,40 @@ menudefs = [
('Go to _Line', '<<goto-line>>'), ('Go to _Line', '<<goto-line>>'),
]), ]),
('format', [ ('format', [
('_Indent Region', '<<indent-region>>'), ('_Indent Region', '<<indent-region>>'),
('_Dedent Region', '<<dedent-region>>'), ('_Dedent Region', '<<dedent-region>>'),
('Comment _Out Region', '<<comment-region>>'), ('Comment _Out Region', '<<comment-region>>'),
('U_ncomment Region', '<<uncomment-region>>'), ('U_ncomment Region', '<<uncomment-region>>'),
('Tabify Region', '<<tabify-region>>'), ('Tabify Region', '<<tabify-region>>'),
('Untabify Region', '<<untabify-region>>'), ('Untabify Region', '<<untabify-region>>'),
('Toggle Tabs', '<<toggle-tabs>>'), ('Toggle Tabs', '<<toggle-tabs>>'),
('New Indent Width', '<<change-indentwidth>>'), ('New Indent Width', '<<change-indentwidth>>'),
]), ]),
('run',[ ('run', [
('Python Shell', '<<open-python-shell>>'), ('Python Shell', '<<open-python-shell>>'),
]), ]),
('shell', [ ('shell', [
('_View Last Restart', '<<view-restart>>'), ('_View Last Restart', '<<view-restart>>'),
('_Restart Shell', '<<restart-shell>>'), ('_Restart Shell', '<<restart-shell>>'),
None, ]),
('debug', [
('_Go to File/Line', '<<goto-file-line>>'), ('_Go to File/Line', '<<goto-file-line>>'),
('!_Debugger', '<<toggle-debugger>>'), ('!_Debugger', '<<toggle-debugger>>'),
('_Stack Viewer', '<<open-stack-viewer>>'), ('_Stack Viewer', '<<open-stack-viewer>>'),
('!_Auto-open Stack Viewer', '<<toggle-jit-stack-viewer>>' ), ('!_Auto-open Stack Viewer', '<<toggle-jit-stack-viewer>>'),
]), ]),
('options', [ ('options', [
('_Configure IDLE...', '<<open-config-dialog>>'), ('_Configure IDLE...', '<<open-config-dialog>>'),
None, None,
('Revert to _Default Settings', '<<revert-all-settings>>'), ('Revert to _Default Settings', '<<revert-all-settings>>'),
]), ]),
('help', [ ('help', [
('_About IDLE', '<<about-idle>>'), ('_About IDLE', '<<about-idle>>'),
('IDLE _Readme', '<<view-readme>>'), ('IDLE _Readme', '<<view-readme>>'),
None, None,
('_IDLE Help', '<<help>>'), ('_IDLE Help', '<<help>>'),
('Python _Docs', '<<python-docs>>'), ('Python _Docs', '<<python-docs>>'),
]), ]),
] ]
default_keydefs = idleConf.GetCurrentKeySet() default_keydefs = idleConf.GetCurrentKeySet()
......
...@@ -368,6 +368,7 @@ class ModifiedInterpreter(InteractiveInterpreter): ...@@ -368,6 +368,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
self.transfer_path() self.transfer_path()
# annotate restart in shell window and mark it # annotate restart in shell window and mark it
console = self.tkconsole console = self.tkconsole
console.text.delete("iomark", "end-1c")
halfbar = ((int(console.width) - 16) // 2) * '=' halfbar = ((int(console.width) - 16) // 2) * '='
console.write(halfbar + ' RESTART ' + halfbar) console.write(halfbar + ' RESTART ' + halfbar)
console.text.mark_set("restart", "end-1c") console.text.mark_set("restart", "end-1c")
...@@ -659,6 +660,7 @@ class PyShell(OutputWindow): ...@@ -659,6 +660,7 @@ class PyShell(OutputWindow):
("file", "_File"), ("file", "_File"),
("edit", "_Edit"), ("edit", "_Edit"),
("shell", "_Shell"), ("shell", "_Shell"),
("debug", "_Debug"),
("options", "_Options"), ("options", "_Options"),
("windows", "_Windows"), ("windows", "_Windows"),
("help", "_Help"), ("help", "_Help"),
...@@ -1007,8 +1009,8 @@ class PyShell(OutputWindow): ...@@ -1007,8 +1009,8 @@ class PyShell(OutputWindow):
# Hack -- use the debugger hooks to be able to handle events # Hack -- use the debugger hooks to be able to handle events
# and interrupt execution at any time. # and interrupt execution at any time.
# This slows execution down quite a bit, so you may want to # This slows execution down quite a bit, so you may want to
# disable this (by not calling settrace() in runcode() above) # disable this (by not calling settrace() in beginexecuting() and
# for full-bore (uninterruptable) speed. # endexecuting() for full-bore (uninterruptable) speed.)
# XXX This should become a user option. # XXX This should become a user option.
if self.canceled: if self.canceled:
return return
......
...@@ -23,6 +23,7 @@ history-next=<Alt-Key-n> <Meta-Key-n> ...@@ -23,6 +23,7 @@ history-next=<Alt-Key-n> <Meta-Key-n>
history-previous=<Alt-Key-p> <Meta-Key-p> history-previous=<Alt-Key-p> <Meta-Key-p>
interrupt-execution=<Control-Key-c> interrupt-execution=<Control-Key-c>
view-restart=<Key-F6> view-restart=<Key-F6>
restart-shell=<Control-Key-F6>
open-class-browser=<Alt-Key-c> <Meta-Key-c> open-class-browser=<Alt-Key-c> <Meta-Key-c>
open-module=<Alt-Key-m> <Meta-Key-m> open-module=<Alt-Key-m> <Meta-Key-m>
open-new-window=<Control-Key-n> open-new-window=<Control-Key-n>
...@@ -69,6 +70,7 @@ history-next=<Alt-Key-n> <Meta-Key-n> ...@@ -69,6 +70,7 @@ history-next=<Alt-Key-n> <Meta-Key-n>
history-previous=<Alt-Key-p> <Meta-Key-p> history-previous=<Alt-Key-p> <Meta-Key-p>
interrupt-execution=<Control-Key-c> interrupt-execution=<Control-Key-c>
view-restart=<Key-F6> view-restart=<Key-F6>
restart-shell=<Control-Key-F6>
open-class-browser=<Control-Key-x><Control-Key-b> open-class-browser=<Control-Key-x><Control-Key-b>
open-module=<Control-Key-x><Control-Key-m> open-module=<Control-Key-x><Control-Key-m>
open-new-window=<Control-Key-x><Control-Key-n> open-new-window=<Control-Key-x><Control-Key-n>
...@@ -119,6 +121,7 @@ history-next=<Control-Key-n> ...@@ -119,6 +121,7 @@ history-next=<Control-Key-n>
history-previous=<Control-Key-p> history-previous=<Control-Key-p>
interrupt-execution=<Control-Key-c> interrupt-execution=<Control-Key-c>
view-restart=<Key-F6> view-restart=<Key-F6>
restart-shell=<Control-Key-F6>
open-class-browser=<Command-Key-b> open-class-browser=<Command-Key-b>
open-module=<Command-Key-m> open-module=<Command-Key-m>
open-new-window=<Command-Key-n> open-new-window=<Command-Key-n>
......
...@@ -522,6 +522,7 @@ class IdleConf: ...@@ -522,6 +522,7 @@ class IdleConf:
'<<history-previous>>': ['<Alt-p>'], '<<history-previous>>': ['<Alt-p>'],
'<<interrupt-execution>>': ['<Control-c>'], '<<interrupt-execution>>': ['<Control-c>'],
'<<view-restart>>': ['<F6>'], '<<view-restart>>': ['<F6>'],
'<<restart-shell>>': ['<Control-F6>'],
'<<open-class-browser>>': ['<Alt-c>'], '<<open-class-browser>>': ['<Alt-c>'],
'<<open-module>>': ['<Alt-m>'], '<<open-module>>': ['<Alt-m>'],
'<<open-new-window>>': ['<Control-n>'], '<<open-new-window>>': ['<Control-n>'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment