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
16e093db
Commit
16e093db
authored
Dec 16, 2014
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20577: move configuration of FormatParagraph extension to new extension
configuration dialog. Patch by Tal Einat.
parent
3004b409
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
24 deletions
+10
-24
Lib/idlelib/FormatParagraph.py
Lib/idlelib/FormatParagraph.py
+4
-2
Lib/idlelib/config-extensions.def
Lib/idlelib/config-extensions.def
+1
-0
Lib/idlelib/config-main.def
Lib/idlelib/config-main.def
+0
-3
Lib/idlelib/configDialog.py
Lib/idlelib/configDialog.py
+0
-19
Misc/NEWS
Misc/NEWS
+5
-0
No files found.
Lib/idlelib/FormatParagraph.py
View file @
16e093db
...
...
@@ -44,9 +44,11 @@ class FormatParagraph:
The length limit parameter is for testing with a known value.
"""
if
limit
==
None
:
if
limit
is
None
:
# The default length limit is that defined by pep8
limit
=
idleConf
.
GetOption
(
'main'
,
'FormatParagraph'
,
'paragraph'
,
type
=
'int'
)
'extensions'
,
'FormatParagraph'
,
'max-width'
,
type
=
'int'
,
default
=
72
)
text
=
self
.
editwin
.
text
first
,
last
=
self
.
editwin
.
get_selection_indices
()
if
first
and
last
:
...
...
Lib/idlelib/config-extensions.def
View file @
16e093db
...
...
@@ -66,6 +66,7 @@ toggle-code-context=
[FormatParagraph]
enable=True
max-width=72
[FormatParagraph_cfgBindings]
format-paragraph=<Alt-Key-q>
...
...
Lib/idlelib/config-main.def
View file @
16e093db
...
...
@@ -58,9 +58,6 @@ font-size= 10
font-bold= 0
encoding= none
[FormatParagraph]
paragraph=72
[Indent]
use-spaces= 1
num-spaces= 4
...
...
Lib/idlelib/configDialog.py
View file @
16e093db
...
...
@@ -371,7 +371,6 @@ class ConfigDialog(Toplevel):
parent
=
self
.
parent
self
.
winWidth
=
StringVar
(
parent
)
self
.
winHeight
=
StringVar
(
parent
)
self
.
paraWidth
=
StringVar
(
parent
)
self
.
startupEdit
=
IntVar
(
parent
)
self
.
autoSave
=
IntVar
(
parent
)
self
.
encoding
=
StringVar
(
parent
)
...
...
@@ -387,7 +386,6 @@ class ConfigDialog(Toplevel):
frameSave
=
LabelFrame
(
frame
,
borderwidth
=
2
,
relief
=
GROOVE
,
text
=
' Autosave Preferences '
)
frameWinSize
=
Frame
(
frame
,
borderwidth
=
2
,
relief
=
GROOVE
)
frameParaSize
=
Frame
(
frame
,
borderwidth
=
2
,
relief
=
GROOVE
)
frameEncoding
=
Frame
(
frame
,
borderwidth
=
2
,
relief
=
GROOVE
)
frameHelp
=
LabelFrame
(
frame
,
borderwidth
=
2
,
relief
=
GROOVE
,
text
=
' Additional Help Sources '
)
...
...
@@ -416,11 +414,6 @@ class ConfigDialog(Toplevel):
labelWinHeightTitle
=
Label
(
frameWinSize
,
text
=
'Height'
)
entryWinHeight
=
Entry
(
frameWinSize
,
textvariable
=
self
.
winHeight
,
width
=
3
)
#paragraphFormatWidth
labelParaWidthTitle
=
Label
(
frameParaSize
,
text
=
'Paragraph reformat width (in characters)'
)
entryParaWidth
=
Entry
(
frameParaSize
,
textvariable
=
self
.
paraWidth
,
width
=
3
)
#frameEncoding
labelEncodingTitle
=
Label
(
frameEncoding
,
text
=
"Default Source Encoding"
)
...
...
@@ -458,7 +451,6 @@ class ConfigDialog(Toplevel):
frameRun
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
fill
=
X
)
frameSave
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
fill
=
X
)
frameWinSize
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
fill
=
X
)
frameParaSize
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
fill
=
X
)
frameEncoding
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
fill
=
X
)
frameHelp
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
expand
=
TRUE
,
fill
=
BOTH
)
#frameRun
...
...
@@ -475,9 +467,6 @@ class ConfigDialog(Toplevel):
labelWinHeightTitle
.
pack
(
side
=
RIGHT
,
anchor
=
E
,
pady
=
5
)
entryWinWidth
.
pack
(
side
=
RIGHT
,
anchor
=
E
,
padx
=
10
,
pady
=
5
)
labelWinWidthTitle
.
pack
(
side
=
RIGHT
,
anchor
=
E
,
pady
=
5
)
#paragraphFormatWidth
labelParaWidthTitle
.
pack
(
side
=
LEFT
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
entryParaWidth
.
pack
(
side
=
RIGHT
,
anchor
=
E
,
padx
=
10
,
pady
=
5
)
#frameEncoding
labelEncodingTitle
.
pack
(
side
=
LEFT
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
radioEncNone
.
pack
(
side
=
RIGHT
,
anchor
=
E
,
pady
=
5
)
...
...
@@ -509,7 +498,6 @@ class ConfigDialog(Toplevel):
self
.
keysAreBuiltin
.
trace_variable
(
'w'
,
self
.
VarChanged_keysAreBuiltin
)
self
.
winWidth
.
trace_variable
(
'w'
,
self
.
VarChanged_winWidth
)
self
.
winHeight
.
trace_variable
(
'w'
,
self
.
VarChanged_winHeight
)
self
.
paraWidth
.
trace_variable
(
'w'
,
self
.
VarChanged_paraWidth
)
self
.
startupEdit
.
trace_variable
(
'w'
,
self
.
VarChanged_startupEdit
)
self
.
autoSave
.
trace_variable
(
'w'
,
self
.
VarChanged_autoSave
)
self
.
encoding
.
trace_variable
(
'w'
,
self
.
VarChanged_encoding
)
...
...
@@ -594,10 +582,6 @@ class ConfigDialog(Toplevel):
value
=
self
.
winHeight
.
get
()
self
.
AddChangedItem
(
'main'
,
'EditorWindow'
,
'height'
,
value
)
def
VarChanged_paraWidth
(
self
,
*
params
):
value
=
self
.
paraWidth
.
get
()
self
.
AddChangedItem
(
'main'
,
'FormatParagraph'
,
'paragraph'
,
value
)
def
VarChanged_startupEdit
(
self
,
*
params
):
value
=
self
.
startupEdit
.
get
()
self
.
AddChangedItem
(
'main'
,
'General'
,
'editor-on-startup'
,
value
)
...
...
@@ -1094,9 +1078,6 @@ class ConfigDialog(Toplevel):
'main'
,
'EditorWindow'
,
'width'
,
type
=
'int'
))
self
.
winHeight
.
set
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'height'
,
type
=
'int'
))
#initial paragraph reformat size
self
.
paraWidth
.
set
(
idleConf
.
GetOption
(
'main'
,
'FormatParagraph'
,
'paragraph'
,
type
=
'int'
))
# default source encoding
self
.
encoding
.
set
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'encoding'
,
default
=
'none'
))
...
...
Misc/NEWS
View file @
16e093db
...
...
@@ -56,6 +56,11 @@ Tests
IDLE
----
- Issue #20577: Configuration of the max line length for the FormatParagraph
extension has been moved from the General tab of the Idle preferences dialog
to the FormatParagraph tab of the Config Extensions dialog.
Patch by Tal Einat.
- Issue #16893: Update Idle doc chapter to match current Idle and add new
information.
...
...
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