M ScriptBinding.py

M config-extensions.def
M help.txt

1. Run Script  -->  Run Module
2. Update IDLE Help file and do more work on format.
This commit is contained in:
Kurt B. Kaiser 2003-01-26 04:17:16 +00:00
parent e685f9438d
commit eb9637ef7d
3 changed files with 65 additions and 55 deletions

View File

@ -11,7 +11,7 @@ This adds the following commands:
XXX GvR Redesign this interface (yet again) as follows: XXX GvR Redesign this interface (yet again) as follows:
- Present a dialog box for ``Run script'' - Present a dialog box for ``Run Module''
- Allow specify command line arguments in the dialog box - Allow specify command line arguments in the dialog box
@ -45,7 +45,7 @@ class ScriptBinding:
menudefs = [ menudefs = [
('run', [None, ('run', [None,
('Check Module', '<<check-module>>'), ('Check Module', '<<check-module>>'),
('Run Script', '<<run-script>>'), ]), ] ('Run Module', '<<run-module>>'), ]), ]
def __init__(self, editwin): def __init__(self, editwin):
self.editwin = editwin self.editwin = editwin
@ -113,8 +113,8 @@ class ScriptBinding:
text.mark_set("insert", pos + "+1c") text.mark_set("insert", pos + "+1c")
text.see(pos) text.see(pos)
def run_script_event(self, event): def run_module_event(self, event):
"Check syntax, if ok run the script in the shell top level" "Check syntax, if ok run the module in the shell top level"
filename = self.getfilename() filename = self.getfilename()
if not filename: if not filename:
return return

View File

@ -31,7 +31,7 @@ zoom-height=<Alt-Key-2>
[ScriptBinding] [ScriptBinding]
enable=1 enable=1
[ScriptBinding_cfgBindings] [ScriptBinding_cfgBindings]
run-script=<Key-F5> run-module=<Key-F5>
check-module=<Alt-Key-x> check-module=<Alt-Key-x>
[CallTips] [CallTips]

View File

@ -5,84 +5,91 @@ separate window containing the menu is created.
File Menu: File Menu:
New Window -- create a new editing window New Window -- Create a new editing window
Open... -- open an existing file Open... -- Open an existing file
Recent Files... -- open a list of recent files Recent Files... -- Open a list of recent files
Open Module... -- open an existing module (searches sys.path) Open Module... -- Open an existing module (searches sys.path)
Class Browser -- show classes and methods in current file Class Browser -- Show classes and methods in current file
Path Browser -- show sys.path directories, modules, classes Path Browser -- Show sys.path directories, modules, classes
and methods and methods
--- ---
Save -- save current window to the associated file (unsaved Save -- Save current window to the associated file (unsaved
windows have a * before and after the window title) windows have a * before and after the window title)
Save As... -- save current window to new file, which becomes Save As... -- Save current window to new file, which becomes
the associated file the associated file
Save Copy As... -- save current window to different file Save Copy As... -- Save current window to different file
without changing the associated file without changing the associated file
--- ---
Print Window -- print the current window Print Window -- Print the current window
--- ---
Close -- close current window (asks to save if unsaved) Close -- Close current window (asks to save if unsaved)
Exit -- close all windows and quit IDLE (asks to save if unsaved) Exit -- Close all windows, quit (asks to save if unsaved)
Edit Menu: Edit Menu:
Undo -- Undo last change to current window (max 1000 changes) Undo -- Undo last change to current window
Redo -- Redo last undone change to current window (A maximum of 1000 changes may be undone)
Redo -- Redo last undone change to current window
--- ---
Cut -- Copy selection into system-wide clipboard; then delete selection Cut -- Copy a selection into system-wide clipboard,
Copy -- Copy selection into system-wide clipboard then delete the selection
Paste -- Insert system-wide clipboard into window Copy -- Copy selection into system-wide clipboard
Select All -- Select the entire contents of the edit buffer Paste -- Insert system-wide clipboard into window
Select All -- Select the entire contents of the edit buffer
--- ---
Find... -- Open a search dialog box with many options Find... -- Open a search dialog box with many options
Find Again -- Repeat last search Find Again -- Repeat last search
Find Selection -- Search for the string in the selection Find Selection -- Search for the string in the selection
Find in Files... -- Open a search dialog box for searching files Find in Files... -- Open a search dialog box for searching files
Replace... -- Open a search-and-replace dialog box Replace... -- Open a search-and-replace dialog box
Go to Line -- Ask for a line number and show that line Go to Line -- Ask for a line number and show that line
Expand Word -- Expand the word you have typed to match another Expand Word -- Expand the word you have typed to match another
word in the same buffer; repeat to get a different word in the same buffer; repeat to get a
expansion different expansion
Format Menu (only in Edit window): Format Menu (only in Edit window):
Indent Region -- Shift selected lines right 4 spaces Indent Region -- Shift selected lines right 4 spaces
Dedent Region -- Shift selected lines left 4 spaces Dedent Region -- Shift selected lines left 4 spaces
Comment Out Region -- Insert ## in front of selected lines Comment Out Region -- Insert ## in front of selected lines
Uncomment Region -- Remove leading # or ## from selected lines Uncomment Region -- Remove leading # or ## from selected lines
Tabify Region -- Turns *leading* stretches of spaces into tabs Tabify Region -- Turns *leading* stretches of spaces into tabs
Untabify Region -- Turn *all* tabs into the right number of spaces Untabify Region -- Turn *all* tabs into the right number of spaces
New Indent Width... -- Open dialog to change indent width New Indent Width... -- Open dialog to change indent width
Format Paragraph -- Reformat the current blank-line-separated paragraph Format Paragraph -- Reformat the current blank-line-separated
paragraph
Run Menu (only in Edit window): Run Menu (only in Edit window):
Python Shell -- Open or wake up the Python shell window Python Shell -- Open or wake up the Python shell window
--- ---
Check Module -- Run a syntax check on the module Check Module -- Run a syntax check on the module
Run Script -- Execute the current file in the __main__ namespace Run Module -- Execute the current file in the __main__ namespace
Shell Menu (only in Shell window): Shell Menu (only in Shell window):
View Last Restart -- Scroll the shell window to the last restart View Last Restart -- Scroll the shell window to the last restart
Restart Shell -- Restart the interpreter with a fresh environment Restart Shell -- Restart the interpreter with a fresh environment
---
Go to File/Line -- look around the insert point for a filename Debug Menu (only in Shell window):
and linenumber, open the file, and show the line
Go to File/Line -- look around the insert point for a filename
and linenumber, open the file, and show the line
Debugger (toggle) -- Run commands in the shell under the debugger Debugger (toggle) -- Run commands in the shell under the debugger
Stack Viewer -- show the stack traceback of the last exception Stack Viewer -- Show the stack traceback of the last exception
Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback
Options Menu: Options Menu:
Configure IDLE -- Open a configuration dialog. Fonts, indentation, Configure IDLE -- Open a configuration dialog. Fonts, indentation,
keybindings, and color themes may be altered. keybindings, and color themes may be altered.
Startup Preferences may be set, and Additional Help Startup Preferences may be set, and Additional Help
Souces can be specified. Souces can be specified.
--- ---
Revert to Default Settings -- Restore original settings Revert to Default Settings -- Restore original settings. Not
currently implemented - simply delete
your .idlerc file.
Windows Menu: Windows Menu:
@ -102,7 +109,7 @@ Help Menu:
Python Docs -- Access local Python documentation, if Python Docs -- Access local Python documentation, if
installed. Otherwise, access www.python.org. installed. Otherwise, access www.python.org.
--- ---
(Additional Help Sources) (Additional Help Sources may be added here)
** TIPS ** ** TIPS **
@ -120,7 +127,7 @@ Additional Help Sources:
All users can access the extensive sources of help, including All users can access the extensive sources of help, including
tutorials, available at www.python.org/doc. Selected URLs can be added tutorials, available at www.python.org/doc. Selected URLs can be added
or removed from the Help menu at any time. or removed from the Help menu at any time using Configure IDLE.
Basic editing and navigation: Basic editing and navigation:
@ -138,7 +145,10 @@ Automatic indentation:
certain keywords (break, return etc.) the next line is certain keywords (break, return etc.) the next line is
dedented. In leading indentation, Backspace deletes up to 4 dedented. In leading indentation, Backspace deletes up to 4
spaces if they are there. Tab inserts spaces (in the spaces if they are there. Tab inserts spaces (in the
Python Shell window one tab), number depends on Indent Width Python Shell window one tab), number depends on Indent Width.
(N.B. Currently tabs are restricted to four spaces due to Tcl/Tk
issues.)
See also the indent/dedent region commands in the edit menu. See also the indent/dedent region commands in the edit menu.
Python Shell window: Python Shell window:
@ -153,7 +163,7 @@ Python Shell window:
Return while on any previous command retrieves that command Return while on any previous command retrieves that command
Alt-/ (Expand word) is also useful here Alt-/ (Expand word) is also useful here
Syntax colors: Syntax colors:
The coloring is applied in a background "thread", so you may The coloring is applied in a background "thread", so you may
occasionally see uncolorized text. To change the color occasionally see uncolorized text. To change the color