Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb9637e

Browse files
committed
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.
1 parent e685f94 commit eb9637e

3 files changed

Lines changed: 65 additions & 55 deletions

File tree

Lib/idlelib/ScriptBinding.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
XXX GvR Redesign this interface (yet again) as follows:
1313
14-
- Present a dialog box for ``Run script''
14+
- Present a dialog box for ``Run Module''
1515
1616
- Allow specify command line arguments in the dialog box
1717
@@ -45,7 +45,7 @@ class ScriptBinding:
4545
menudefs = [
4646
('run', [None,
4747
('Check Module', '<<check-module>>'),
48-
('Run Script', '<<run-script>>'), ]), ]
48+
('Run Module', '<<run-module>>'), ]), ]
4949

5050
def __init__(self, editwin):
5151
self.editwin = editwin
@@ -113,8 +113,8 @@ def colorize_syntax_error(self, msg, lineno, offset):
113113
text.mark_set("insert", pos + "+1c")
114114
text.see(pos)
115115

116-
def run_script_event(self, event):
117-
"Check syntax, if ok run the script in the shell top level"
116+
def run_module_event(self, event):
117+
"Check syntax, if ok run the module in the shell top level"
118118
filename = self.getfilename()
119119
if not filename:
120120
return

Lib/idlelib/config-extensions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ zoom-height=<Alt-Key-2>
3131
[ScriptBinding]
3232
enable=1
3333
[ScriptBinding_cfgBindings]
34-
run-script=<Key-F5>
34+
run-module=<Key-F5>
3535
check-module=<Alt-Key-x>
3636

3737
[CallTips]

Lib/idlelib/help.txt

Lines changed: 60 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,84 +5,91 @@ separate window containing the menu is created.
55

66
File Menu:
77

8-
New Window -- create a new editing window
9-
Open... -- open an existing file
10-
Recent Files... -- open a list of recent files
11-
Open Module... -- open an existing module (searches sys.path)
12-
Class Browser -- show classes and methods in current file
13-
Path Browser -- show sys.path directories, modules, classes
14-
and methods
8+
New Window -- Create a new editing window
9+
Open... -- Open an existing file
10+
Recent Files... -- Open a list of recent files
11+
Open Module... -- Open an existing module (searches sys.path)
12+
Class Browser -- Show classes and methods in current file
13+
Path Browser -- Show sys.path directories, modules, classes
14+
and methods
1515
---
16-
Save -- save current window to the associated file (unsaved
17-
windows have a * before and after the window title)
16+
Save -- Save current window to the associated file (unsaved
17+
windows have a * before and after the window title)
1818

19-
Save As... -- save current window to new file, which becomes
20-
the associated file
21-
Save Copy As... -- save current window to different file
22-
without changing the associated file
19+
Save As... -- Save current window to new file, which becomes
20+
the associated file
21+
Save Copy As... -- Save current window to different file
22+
without changing the associated file
2323
---
24-
Print Window -- print the current window
24+
Print Window -- Print the current window
2525
---
26-
Close -- close current window (asks to save if unsaved)
27-
Exit -- close all windows and quit IDLE (asks to save if unsaved)
26+
Close -- Close current window (asks to save if unsaved)
27+
Exit -- Close all windows, quit (asks to save if unsaved)
2828

2929
Edit Menu:
3030

31-
Undo -- Undo last change to current window (max 1000 changes)
32-
Redo -- Redo last undone change to current window
31+
Undo -- Undo last change to current window
32+
(A maximum of 1000 changes may be undone)
33+
Redo -- Redo last undone change to current window
3334
---
34-
Cut -- Copy selection into system-wide clipboard; then delete selection
35-
Copy -- Copy selection into system-wide clipboard
36-
Paste -- Insert system-wide clipboard into window
37-
Select All -- Select the entire contents of the edit buffer
35+
Cut -- Copy a selection into system-wide clipboard,
36+
then delete the selection
37+
Copy -- Copy selection into system-wide clipboard
38+
Paste -- Insert system-wide clipboard into window
39+
Select All -- Select the entire contents of the edit buffer
3840
---
39-
Find... -- Open a search dialog box with many options
40-
Find Again -- Repeat last search
41-
Find Selection -- Search for the string in the selection
41+
Find... -- Open a search dialog box with many options
42+
Find Again -- Repeat last search
43+
Find Selection -- Search for the string in the selection
4244
Find in Files... -- Open a search dialog box for searching files
43-
Replace... -- Open a search-and-replace dialog box
44-
Go to Line -- Ask for a line number and show that line
45-
Expand Word -- Expand the word you have typed to match another
46-
word in the same buffer; repeat to get a different
47-
expansion
45+
Replace... -- Open a search-and-replace dialog box
46+
Go to Line -- Ask for a line number and show that line
47+
Expand Word -- Expand the word you have typed to match another
48+
word in the same buffer; repeat to get a
49+
different expansion
4850

4951
Format Menu (only in Edit window):
5052

51-
Indent Region -- Shift selected lines right 4 spaces
52-
Dedent Region -- Shift selected lines left 4 spaces
53-
Comment Out Region -- Insert ## in front of selected lines
54-
Uncomment Region -- Remove leading # or ## from selected lines
55-
Tabify Region -- Turns *leading* stretches of spaces into tabs
56-
Untabify Region -- Turn *all* tabs into the right number of spaces
53+
Indent Region -- Shift selected lines right 4 spaces
54+
Dedent Region -- Shift selected lines left 4 spaces
55+
Comment Out Region -- Insert ## in front of selected lines
56+
Uncomment Region -- Remove leading # or ## from selected lines
57+
Tabify Region -- Turns *leading* stretches of spaces into tabs
58+
Untabify Region -- Turn *all* tabs into the right number of spaces
5759
New Indent Width... -- Open dialog to change indent width
58-
Format Paragraph -- Reformat the current blank-line-separated paragraph
60+
Format Paragraph -- Reformat the current blank-line-separated
61+
paragraph
5962

6063
Run Menu (only in Edit window):
6164

6265
Python Shell -- Open or wake up the Python shell window
6366
---
6467
Check Module -- Run a syntax check on the module
65-
Run Script -- Execute the current file in the __main__ namespace
68+
Run Module -- Execute the current file in the __main__ namespace
6669

6770
Shell Menu (only in Shell window):
6871

6972
View Last Restart -- Scroll the shell window to the last restart
70-
Restart Shell -- Restart the interpreter with a fresh environment
71-
---
72-
Go to File/Line -- look around the insert point for a filename
73-
and linenumber, open the file, and show the line
73+
Restart Shell -- Restart the interpreter with a fresh environment
74+
75+
Debug Menu (only in Shell window):
76+
77+
Go to File/Line -- look around the insert point for a filename
78+
and linenumber, open the file, and show the line
7479
Debugger (toggle) -- Run commands in the shell under the debugger
75-
Stack Viewer -- show the stack traceback of the last exception
80+
Stack Viewer -- Show the stack traceback of the last exception
7681
Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback
7782

7883
Options Menu:
7984

8085
Configure IDLE -- Open a configuration dialog. Fonts, indentation,
81-
keybindings, and color themes may be altered.
86+
keybindings, and color themes may be altered.
8287
Startup Preferences may be set, and Additional Help
83-
Souces can be specified.
88+
Souces can be specified.
8489
---
85-
Revert to Default Settings -- Restore original settings
90+
Revert to Default Settings -- Restore original settings. Not
91+
currently implemented - simply delete
92+
your .idlerc file.
8693

8794
Windows Menu:
8895

@@ -102,7 +109,7 @@ Help Menu:
102109
Python Docs -- Access local Python documentation, if
103110
installed. Otherwise, access www.python.org.
104111
---
105-
(Additional Help Sources)
112+
(Additional Help Sources may be added here)
106113

107114

108115
** TIPS **
@@ -120,7 +127,7 @@ Additional Help Sources:
120127

121128
All users can access the extensive sources of help, including
122129
tutorials, available at www.python.org/doc. Selected URLs can be added
123-
or removed from the Help menu at any time.
130+
or removed from the Help menu at any time using Configure IDLE.
124131

125132
Basic editing and navigation:
126133

@@ -138,7 +145,10 @@ Automatic indentation:
138145
certain keywords (break, return etc.) the next line is
139146
dedented. In leading indentation, Backspace deletes up to 4
140147
spaces if they are there. Tab inserts spaces (in the
141-
Python Shell window one tab), number depends on Indent Width
148+
Python Shell window one tab), number depends on Indent Width.
149+
(N.B. Currently tabs are restricted to four spaces due to Tcl/Tk
150+
issues.)
151+
142152
See also the indent/dedent region commands in the edit menu.
143153

144154
Python Shell window:
@@ -153,7 +163,7 @@ Python Shell window:
153163
Return while on any previous command retrieves that command
154164
Alt-/ (Expand word) is also useful here
155165

156-
Syntax colors:
166+
Syntax colors:
157167

158168
The coloring is applied in a background "thread", so you may
159169
occasionally see uncolorized text. To change the color

0 commit comments

Comments
 (0)