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
e19f3ec0
Commit
e19f3ec0
authored
Nov 12, 2015
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Plain Diff
Merge with 3.4
parents
2f855555
d0c0f004
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
25 deletions
+48
-25
Lib/idlelib/ClassBrowser.py
Lib/idlelib/ClassBrowser.py
+1
-1
Lib/idlelib/ColorDelegator.py
Lib/idlelib/ColorDelegator.py
+1
-1
Lib/idlelib/EditorWindow.py
Lib/idlelib/EditorWindow.py
+1
-1
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+3
-3
Lib/idlelib/TreeWidget.py
Lib/idlelib/TreeWidget.py
+1
-1
Lib/idlelib/config-main.def
Lib/idlelib/config-main.def
+2
-0
Lib/idlelib/configDialog.py
Lib/idlelib/configDialog.py
+13
-16
Lib/idlelib/configHandler.py
Lib/idlelib/configHandler.py
+26
-2
No files found.
Lib/idlelib/ClassBrowser.py
View file @
e19f3ec0
...
@@ -56,7 +56,7 @@ class ClassBrowser:
...
@@ -56,7 +56,7 @@ class ClassBrowser:
self
.
settitle
()
self
.
settitle
()
top
.
focus_set
()
top
.
focus_set
()
# create scrolled canvas
# create scrolled canvas
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
theme
=
idleConf
.
CurrentTheme
(
)
background
=
idleConf
.
GetHighlight
(
theme
,
'normal'
)[
'background'
]
background
=
idleConf
.
GetHighlight
(
theme
,
'normal'
)[
'background'
]
sc
=
ScrolledCanvas
(
top
,
bg
=
background
,
highlightthickness
=
0
,
takefocus
=
1
)
sc
=
ScrolledCanvas
(
top
,
bg
=
background
,
highlightthickness
=
0
,
takefocus
=
1
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
)
...
...
Lib/idlelib/ColorDelegator.py
View file @
e19f3ec0
...
@@ -60,7 +60,7 @@ class ColorDelegator(Delegator):
...
@@ -60,7 +60,7 @@ class ColorDelegator(Delegator):
self
.
tag_raise
(
'sel'
)
self
.
tag_raise
(
'sel'
)
def
LoadTagDefs
(
self
):
def
LoadTagDefs
(
self
):
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
theme
=
idleConf
.
CurrentTheme
(
)
self
.
tagdefs
=
{
self
.
tagdefs
=
{
"COMMENT"
:
idleConf
.
GetHighlight
(
theme
,
"comment"
),
"COMMENT"
:
idleConf
.
GetHighlight
(
theme
,
"comment"
),
"KEYWORD"
:
idleConf
.
GetHighlight
(
theme
,
"keyword"
),
"KEYWORD"
:
idleConf
.
GetHighlight
(
theme
,
"keyword"
),
...
...
Lib/idlelib/EditorWindow.py
View file @
e19f3ec0
...
@@ -739,7 +739,7 @@ class EditorWindow(object):
...
@@ -739,7 +739,7 @@ class EditorWindow(object):
# Called from self.filename_change_hook and from configDialog.py
# Called from self.filename_change_hook and from configDialog.py
self
.
_rmcolorizer
()
self
.
_rmcolorizer
()
self
.
_addcolorizer
()
self
.
_addcolorizer
()
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
theme
=
idleConf
.
CurrentTheme
(
)
normal_colors
=
idleConf
.
GetHighlight
(
theme
,
'normal'
)
normal_colors
=
idleConf
.
GetHighlight
(
theme
,
'normal'
)
cursor_color
=
idleConf
.
GetHighlight
(
theme
,
'cursor'
,
fgBg
=
'fg'
)
cursor_color
=
idleConf
.
GetHighlight
(
theme
,
'cursor'
,
fgBg
=
'fg'
)
select_colors
=
idleConf
.
GetHighlight
(
theme
,
'hilite'
)
select_colors
=
idleConf
.
GetHighlight
(
theme
,
'hilite'
)
...
...
Lib/idlelib/PyShell.py
View file @
e19f3ec0
...
@@ -152,7 +152,7 @@ class PyShellEditorWindow(EditorWindow):
...
@@ -152,7 +152,7 @@ class PyShellEditorWindow(EditorWindow):
# possible due to update in restore_file_breaks
# possible due to update in restore_file_breaks
return
return
if
color
:
if
color
:
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
theme
=
idleConf
.
CurrentTheme
(
)
cfg
=
idleConf
.
GetHighlight
(
theme
,
"break"
)
cfg
=
idleConf
.
GetHighlight
(
theme
,
"break"
)
else
:
else
:
cfg
=
{
'foreground'
:
''
,
'background'
:
''
}
cfg
=
{
'foreground'
:
''
,
'background'
:
''
}
...
@@ -338,7 +338,7 @@ class ModifiedColorDelegator(ColorDelegator):
...
@@ -338,7 +338,7 @@ class ModifiedColorDelegator(ColorDelegator):
def
LoadTagDefs
(
self
):
def
LoadTagDefs
(
self
):
ColorDelegator
.
LoadTagDefs
(
self
)
ColorDelegator
.
LoadTagDefs
(
self
)
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
theme
=
idleConf
.
CurrentTheme
(
)
self
.
tagdefs
.
update
({
self
.
tagdefs
.
update
({
"stdin"
:
{
'background'
:
None
,
'foreground'
:
None
},
"stdin"
:
{
'background'
:
None
,
'foreground'
:
None
},
"stdout"
:
idleConf
.
GetHighlight
(
theme
,
"stdout"
),
"stdout"
:
idleConf
.
GetHighlight
(
theme
,
"stdout"
),
...
@@ -621,7 +621,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -621,7 +621,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
item
=
RemoteObjectBrowser
.
StubObjectTreeItem
(
self
.
rpcclt
,
oid
)
item
=
RemoteObjectBrowser
.
StubObjectTreeItem
(
self
.
rpcclt
,
oid
)
from
idlelib.TreeWidget
import
ScrolledCanvas
,
TreeNode
from
idlelib.TreeWidget
import
ScrolledCanvas
,
TreeNode
top
=
Toplevel
(
self
.
tkconsole
.
root
)
top
=
Toplevel
(
self
.
tkconsole
.
root
)
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
theme
=
idleConf
.
CurrentTheme
(
)
background
=
idleConf
.
GetHighlight
(
theme
,
'normal'
)[
'background'
]
background
=
idleConf
.
GetHighlight
(
theme
,
'normal'
)[
'background'
]
sc
=
ScrolledCanvas
(
top
,
bg
=
background
,
highlightthickness
=
0
)
sc
=
ScrolledCanvas
(
top
,
bg
=
background
,
highlightthickness
=
0
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
)
...
...
Lib/idlelib/TreeWidget.py
View file @
e19f3ec0
...
@@ -249,7 +249,7 @@ class TreeNode:
...
@@ -249,7 +249,7 @@ class TreeNode:
except
AttributeError
:
except
AttributeError
:
# padding carefully selected (on Windows) to match Entry widget:
# padding carefully selected (on Windows) to match Entry widget:
self
.
label
=
Label
(
self
.
canvas
,
text
=
text
,
bd
=
0
,
padx
=
2
,
pady
=
2
)
self
.
label
=
Label
(
self
.
canvas
,
text
=
text
,
bd
=
0
,
padx
=
2
,
pady
=
2
)
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
theme
=
idleConf
.
CurrentTheme
(
)
if
self
.
selected
:
if
self
.
selected
:
self
.
label
.
configure
(
idleConf
.
GetHighlight
(
theme
,
'hilite'
))
self
.
label
.
configure
(
idleConf
.
GetHighlight
(
theme
,
'hilite'
))
else
:
else
:
...
...
Lib/idlelib/config-main.def
View file @
e19f3ec0
...
@@ -65,6 +65,8 @@ num-spaces= 4
...
@@ -65,6 +65,8 @@ num-spaces= 4
[Theme]
[Theme]
default= 1
default= 1
name= IDLE Classic
name= IDLE Classic
name2=
# name2 set in user config-main.cfg for themes added after 2015 Oct 1
[Keys]
[Keys]
default= 1
default= 1
...
...
Lib/idlelib/configDialog.py
View file @
e19f3ec0
...
@@ -263,6 +263,7 @@ class ConfigDialog(Toplevel):
...
@@ -263,6 +263,7 @@ class ConfigDialog(Toplevel):
self
.
buttonDeleteCustomTheme
=
Button
(
self
.
buttonDeleteCustomTheme
=
Button
(
frameTheme
,
text
=
'Delete Custom Theme'
,
frameTheme
,
text
=
'Delete Custom Theme'
,
command
=
self
.
DeleteCustomTheme
)
command
=
self
.
DeleteCustomTheme
)
self
.
new_custom_theme
=
Label
(
frameTheme
,
bd
=
2
)
##widget packing
##widget packing
#body
#body
...
@@ -286,6 +287,7 @@ class ConfigDialog(Toplevel):
...
@@ -286,6 +287,7 @@ class ConfigDialog(Toplevel):
self
.
optMenuThemeBuiltin
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
optMenuThemeBuiltin
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
optMenuThemeCustom
.
pack
(
side
=
TOP
,
fill
=
X
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
self
.
optMenuThemeCustom
.
pack
(
side
=
TOP
,
fill
=
X
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
self
.
buttonDeleteCustomTheme
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
buttonDeleteCustomTheme
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
new_custom_theme
.
pack
(
side
=
TOP
,
fill
=
X
,
pady
=
5
)
return
frame
return
frame
def
CreatePageKeys
(
self
):
def
CreatePageKeys
(
self
):
...
@@ -503,20 +505,15 @@ class ConfigDialog(Toplevel):
...
@@ -503,20 +505,15 @@ class ConfigDialog(Toplevel):
def
VarChanged_builtinTheme
(
self
,
*
params
):
def
VarChanged_builtinTheme
(
self
,
*
params
):
value
=
self
.
builtinTheme
.
get
()
value
=
self
.
builtinTheme
.
get
()
if
value
==
'IDLE Dark'
:
if
value
==
'IDLE Dark'
:
tkMessageBox
.
showwarning
(
if
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
!=
'IDLE New'
:
title
=
"The 'IDLE Dark' Text Color Theme"
,
self
.
AddChangedItem
(
'main'
,
'Theme'
,
'name'
,
'IDLE Classic'
)
message
=
"IDLE Dark is new in October, 2015. Trying to "
self
.
AddChangedItem
(
'main'
,
'Theme'
,
'name2'
,
value
)
"run earlier versions of IDLE with it selected "
self
.
new_custom_theme
.
config
(
text
=
'New theme, see Help'
,
"will disable colorizing, or worse.
\
n
\
n
"
fg
=
'#500000'
)
"If you might ever run an earlier release of IDLE, "
else
:
"then before exiting this version, "
"either switch to another theme or "
"hit the 'Save as New Custom Theme' button. "
"The latter requires a new name, such as "
"'Custom Dark', but the custom theme will work "
"with any IDLE release, and can be modified."
,
parent
=
self
)
self
.
AddChangedItem
(
'main'
,
'Theme'
,
'name'
,
value
)
self
.
AddChangedItem
(
'main'
,
'Theme'
,
'name'
,
value
)
self
.
AddChangedItem
(
'main'
,
'Theme'
,
'name2'
,
''
)
self
.
new_custom_theme
.
config
(
text
=
''
,
fg
=
'black'
)
self
.
PaintThemeSample
()
self
.
PaintThemeSample
()
def
VarChanged_customTheme
(
self
,
*
params
):
def
VarChanged_customTheme
(
self
,
*
params
):
...
@@ -1350,14 +1347,14 @@ help_common = '''\
...
@@ -1350,14 +1347,14 @@ help_common = '''\
When you click either the Apply or Ok buttons, settings in this
When you click either the Apply or Ok buttons, settings in this
dialog that are different from IDLE's default are saved in
dialog that are different from IDLE's default are saved in
a .idlerc directory in your home directory. Except as noted,
a .idlerc directory in your home directory. Except as noted,
hese changes apply to all versions of IDLE installed on this
t
hese changes apply to all versions of IDLE installed on this
machine. Some do not take affect until IDLE is restarted.
machine. Some do not take affect until IDLE is restarted.
[Cancel] only cancels changes made since the last save.
[Cancel] only cancels changes made since the last save.
'''
'''
help_pages
=
{
help_pages
=
{
'Highlighting'
:
'''
'Highlighting'
:
'''
Highlighting:
Highlighting:
The IDLE Dark color theme is new in Octo
v
er 2015. It can only
The IDLE Dark color theme is new in Octo
b
er 2015. It can only
be used with older IDLE releases if it is saved as a custom
be used with older IDLE releases if it is saved as a custom
theme, with a different name.
theme, with a different name.
'''
'''
...
...
Lib/idlelib/configHandler.py
View file @
e19f3ec0
...
@@ -372,8 +372,32 @@ class IdleConf:
...
@@ -372,8 +372,32 @@ class IdleConf:
return
theme
return
theme
def
CurrentTheme
(
self
):
def
CurrentTheme
(
self
):
"Return the name of the currently active theme."
"""Return the name of the currently active text color theme.
return
self
.
GetOption
(
'main'
,
'Theme'
,
'name'
,
default
=
''
)
idlelib.config-main.def includes this section
[Theme]
default= 1
name= IDLE Classic
name2=
# name2 set in user config-main.cfg for themes added after 2015 Oct 1
Item name2 is needed because setting name to a new builtin
causes older IDLEs to display multiple error messages or quit.
See https://bugs.python.org/issue25313.
When default = True, name2 takes precedence over name,
while older IDLEs will just use name.
"""
default
=
self
.
GetOption
(
'main'
,
'Theme'
,
'default'
,
type
=
'bool'
,
default
=
True
)
if
default
:
theme
=
self
.
GetOption
(
'main'
,
'Theme'
,
'name2'
,
default
=
''
)
if
default
and
not
theme
or
not
default
:
theme
=
self
.
GetOption
(
'main'
,
'Theme'
,
'name'
,
default
=
''
)
source
=
self
.
defaultCfg
if
default
else
self
.
userCfg
if
source
[
'highlight'
].
has_section
(
theme
):
return
theme
else
:
return
"IDLE Classic"
def
CurrentKeys
(
self
):
def
CurrentKeys
(
self
):
"Return the name of the currently active key set."
"Return the name of the currently active key set."
...
...
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