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
7028e598
Commit
7028e598
authored
Aug 26, 2017
by
Cheryl Sabella
Committed by
Terry Jan Reedy
Aug 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-30781: IDLE - use ttk widgets in configdialog (#2654)
Patch by Cheryl Sabella.
parent
0780bf75
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
86 deletions
+87
-86
Lib/idlelib/configdialog.py
Lib/idlelib/configdialog.py
+54
-55
Lib/idlelib/idle_test/test_configdialog.py
Lib/idlelib/idle_test/test_configdialog.py
+31
-30
Misc/NEWS.d/next/IDLE/2017-07-28-18-59-06.bpo-30781.ud5m18.rst
...NEWS.d/next/IDLE/2017-07-28-18-59-06.bpo-30781.ud5m18.rst
+2
-1
No files found.
Lib/idlelib/configdialog.py
View file @
7028e598
This diff is collapsed.
Click to expand it.
Lib/idlelib/idle_test/test_configdialog.py
View file @
7028e598
...
@@ -272,7 +272,7 @@ class HighPageTest(unittest.TestCase):
...
@@ -272,7 +272,7 @@ class HighPageTest(unittest.TestCase):
# builtinlist sets variable builtin_name to the CurrentTheme default.
# builtinlist sets variable builtin_name to the CurrentTheme default.
eq
(
d
.
builtin_name
.
get
(),
'IDLE Classic'
)
eq
(
d
.
builtin_name
.
get
(),
'IDLE Classic'
)
eq
(
d
.
custom_name
.
get
(),
'- no custom themes -'
)
eq
(
d
.
custom_name
.
get
(),
'- no custom themes -'
)
eq
(
d
.
custom_theme_on
[
'state'
],
DISABLED
)
eq
(
d
.
custom_theme_on
.
state
(),
(
'disabled'
,)
)
eq
(
d
.
set_theme_type
.
called
,
1
)
eq
(
d
.
set_theme_type
.
called
,
1
)
eq
(
d
.
paint_theme_sample
.
called
,
1
)
eq
(
d
.
paint_theme_sample
.
called
,
1
)
eq
(
d
.
set_highlight_target
.
called
,
1
)
eq
(
d
.
set_highlight_target
.
called
,
1
)
...
@@ -315,7 +315,7 @@ class HighPageTest(unittest.TestCase):
...
@@ -315,7 +315,7 @@ class HighPageTest(unittest.TestCase):
changes
.
clear
()
changes
.
clear
()
# Custom selected.
# Custom selected.
d
.
custom_theme_on
[
'state'
]
=
NORMAL
d
.
custom_theme_on
.
state
((
'!disabled'
,))
d
.
custom_theme_on
.
invoke
()
d
.
custom_theme_on
.
invoke
()
self
.
assertEqual
(
mainpage
,
{
'Theme'
:
{
'default'
:
'False'
}})
self
.
assertEqual
(
mainpage
,
{
'Theme'
:
{
'default'
:
'False'
}})
eq
(
d
.
var_changed_builtin_name
.
called
,
1
)
eq
(
d
.
var_changed_builtin_name
.
called
,
1
)
...
@@ -428,15 +428,15 @@ class HighPageTest(unittest.TestCase):
...
@@ -428,15 +428,15 @@ class HighPageTest(unittest.TestCase):
d
.
set_theme_type
()
d
.
set_theme_type
()
eq
(
d
.
builtinlist
[
'state'
],
NORMAL
)
eq
(
d
.
builtinlist
[
'state'
],
NORMAL
)
eq
(
d
.
customlist
[
'state'
],
DISABLED
)
eq
(
d
.
customlist
[
'state'
],
DISABLED
)
eq
(
d
.
button_delete_custom
[
'state'
],
DISABLED
)
eq
(
d
.
button_delete_custom
.
state
(),
(
'disabled'
,)
)
# Custom theme selected.
# Custom theme selected.
d
.
theme_source
.
set
(
False
)
d
.
theme_source
.
set
(
False
)
d
.
set_theme_type
()
d
.
set_theme_type
()
eq
(
d
.
builtinlist
[
'state'
],
DISABLED
)
eq
(
d
.
builtinlist
[
'state'
],
DISABLED
)
eq
(
d
.
custom_theme_on
[
'state'
],
NORMAL
)
eq
(
d
.
custom_theme_on
.
state
(),
(
'selected'
,)
)
eq
(
d
.
customlist
[
'state'
],
NORMAL
)
eq
(
d
.
customlist
[
'state'
],
NORMAL
)
eq
(
d
.
button_delete_custom
[
'state'
],
NORMAL
)
eq
(
d
.
button_delete_custom
.
state
(),
()
)
d
.
set_theme_type
=
Func
()
d
.
set_theme_type
=
Func
()
def
test_get_color
(
self
):
def
test_get_color
(
self
):
...
@@ -455,7 +455,7 @@ class HighPageTest(unittest.TestCase):
...
@@ -455,7 +455,7 @@ class HighPageTest(unittest.TestCase):
eq
(
d
.
color
.
get
(),
'#ffffff'
)
eq
(
d
.
color
.
get
(),
'#ffffff'
)
# Selection same as previous color.
# Selection same as previous color.
chooser
.
result
=
(
''
,
d
.
frame_color_set
.
cget
(
'bg
'
))
chooser
.
result
=
(
''
,
d
.
style
.
lookup
(
d
.
frame_color_set
[
'style'
],
'background
'
))
d
.
button_set_color
.
invoke
()
d
.
button_set_color
.
invoke
()
eq
(
d
.
color
.
get
(),
'#ffffff'
)
eq
(
d
.
color
.
get
(),
'#ffffff'
)
...
@@ -494,7 +494,7 @@ class HighPageTest(unittest.TestCase):
...
@@ -494,7 +494,7 @@ class HighPageTest(unittest.TestCase):
d
.
fg_bg_toggle
.
set
(
True
)
d
.
fg_bg_toggle
.
set
(
True
)
d
.
color
.
set
(
color
)
d
.
color
.
set
(
color
)
self
.
assertEqual
(
d
.
frame_color_set
.
cget
(
'bg
'
),
color
)
self
.
assertEqual
(
d
.
style
.
lookup
(
d
.
frame_color_set
[
'style'
],
'background
'
),
color
)
self
.
assertEqual
(
d
.
highlight_sample
.
tag_cget
(
'hilite'
,
'foreground'
),
color
)
self
.
assertEqual
(
d
.
highlight_sample
.
tag_cget
(
'hilite'
,
'foreground'
),
color
)
self
.
assertEqual
(
highpage
,
self
.
assertEqual
(
highpage
,
{
'Python'
:
{
'hilite-foreground'
:
color
}})
{
'Python'
:
{
'hilite-foreground'
:
color
}})
...
@@ -567,15 +567,15 @@ class HighPageTest(unittest.TestCase):
...
@@ -567,15 +567,15 @@ class HighPageTest(unittest.TestCase):
# Target is cursor.
# Target is cursor.
d
.
highlight_target
.
set
(
'Cursor'
)
d
.
highlight_target
.
set
(
'Cursor'
)
eq
(
d
.
fg_on
[
'state'
],
DISABLED
)
eq
(
d
.
fg_on
.
state
(),
(
'disabled'
,
'selected'
)
)
eq
(
d
.
bg_on
[
'state'
],
DISABLED
)
eq
(
d
.
bg_on
.
state
(),
(
'disabled'
,)
)
self
.
assertTrue
(
d
.
fg_bg_toggle
)
self
.
assertTrue
(
d
.
fg_bg_toggle
)
eq
(
d
.
set_color_sample
.
called
,
1
)
eq
(
d
.
set_color_sample
.
called
,
1
)
# Target is not cursor.
# Target is not cursor.
d
.
highlight_target
.
set
(
'Comment'
)
d
.
highlight_target
.
set
(
'Comment'
)
eq
(
d
.
fg_on
[
'state'
],
NORMAL
)
eq
(
d
.
fg_on
.
state
(),
(
'selected'
,)
)
eq
(
d
.
bg_on
[
'state'
],
NORMAL
)
eq
(
d
.
bg_on
.
state
(),
()
)
self
.
assertTrue
(
d
.
fg_bg_toggle
)
self
.
assertTrue
(
d
.
fg_bg_toggle
)
eq
(
d
.
set_color_sample
.
called
,
2
)
eq
(
d
.
set_color_sample
.
called
,
2
)
...
@@ -597,7 +597,8 @@ class HighPageTest(unittest.TestCase):
...
@@ -597,7 +597,8 @@ class HighPageTest(unittest.TestCase):
d
.
highlight_target
.
set
(
'Selected Text'
)
d
.
highlight_target
.
set
(
'Selected Text'
)
d
.
fg_bg_toggle
.
set
(
True
)
d
.
fg_bg_toggle
.
set
(
True
)
d
.
set_color_sample
()
d
.
set_color_sample
()
self
.
assertEqual
(
d
.
frame_color_set
.
cget
(
'bg'
),
self
.
assertEqual
(
d
.
style
.
lookup
(
d
.
frame_color_set
[
'style'
],
'background'
),
d
.
highlight_sample
.
tag_cget
(
'hilite'
,
'foreground'
))
d
.
highlight_sample
.
tag_cget
(
'hilite'
,
'foreground'
))
d
.
set_color_sample
=
Func
()
d
.
set_color_sample
=
Func
()
...
@@ -641,7 +642,7 @@ class HighPageTest(unittest.TestCase):
...
@@ -641,7 +642,7 @@ class HighPageTest(unittest.TestCase):
def
test_delete_custom
(
self
):
def
test_delete_custom
(
self
):
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
d
=
self
.
page
d
=
self
.
page
d
.
button_delete_custom
[
'state'
]
=
NORMAL
d
.
button_delete_custom
.
state
((
'!disabled'
,))
yesno
=
configdialog
.
tkMessageBox
.
askyesno
=
Func
()
yesno
=
configdialog
.
tkMessageBox
.
askyesno
=
Func
()
dialog
.
deactivate_current_config
=
Func
()
dialog
.
deactivate_current_config
=
Func
()
dialog
.
activate_config_changes
=
Func
()
dialog
.
activate_config_changes
=
Func
()
...
@@ -670,7 +671,7 @@ class HighPageTest(unittest.TestCase):
...
@@ -670,7 +671,7 @@ class HighPageTest(unittest.TestCase):
eq
(
yesno
.
called
,
2
)
eq
(
yesno
.
called
,
2
)
self
.
assertNotIn
(
theme_name
,
highpage
)
self
.
assertNotIn
(
theme_name
,
highpage
)
eq
(
idleConf
.
GetSectionList
(
'user'
,
'highlight'
),
[])
eq
(
idleConf
.
GetSectionList
(
'user'
,
'highlight'
),
[])
eq
(
d
.
custom_theme_on
[
'state'
],
DISABLED
)
eq
(
d
.
custom_theme_on
.
state
(),
(
'disabled'
,)
)
eq
(
d
.
custom_name
.
get
(),
'- no custom themes -'
)
eq
(
d
.
custom_name
.
get
(),
'- no custom themes -'
)
eq
(
dialog
.
deactivate_current_config
.
called
,
1
)
eq
(
dialog
.
deactivate_current_config
.
called
,
1
)
eq
(
dialog
.
activate_config_changes
.
called
,
1
)
eq
(
dialog
.
activate_config_changes
.
called
,
1
)
...
@@ -721,7 +722,7 @@ class KeysPageTest(unittest.TestCase):
...
@@ -721,7 +722,7 @@ class KeysPageTest(unittest.TestCase):
# builtinlist sets variable builtin_name to the CurrentKeys default.
# builtinlist sets variable builtin_name to the CurrentKeys default.
eq
(
d
.
builtin_name
.
get
(),
'IDLE Classic OSX'
)
eq
(
d
.
builtin_name
.
get
(),
'IDLE Classic OSX'
)
eq
(
d
.
custom_name
.
get
(),
'- no custom keys -'
)
eq
(
d
.
custom_name
.
get
(),
'- no custom keys -'
)
eq
(
d
.
custom_keyset_on
[
'state'
],
DISABLED
)
eq
(
d
.
custom_keyset_on
.
state
(),
(
'disabled'
,)
)
eq
(
d
.
set_keys_type
.
called
,
1
)
eq
(
d
.
set_keys_type
.
called
,
1
)
eq
(
d
.
load_keys_list
.
called
,
1
)
eq
(
d
.
load_keys_list
.
called
,
1
)
eq
(
d
.
load_keys_list
.
args
,
(
'IDLE Classic OSX'
,
))
eq
(
d
.
load_keys_list
.
args
,
(
'IDLE Classic OSX'
,
))
...
@@ -765,7 +766,7 @@ class KeysPageTest(unittest.TestCase):
...
@@ -765,7 +766,7 @@ class KeysPageTest(unittest.TestCase):
changes
.
clear
()
changes
.
clear
()
# Custom selected.
# Custom selected.
d
.
custom_keyset_on
[
'state'
]
=
NORMAL
d
.
custom_keyset_on
.
state
((
'!disabled'
,))
d
.
custom_keyset_on
.
invoke
()
d
.
custom_keyset_on
.
invoke
()
self
.
assertEqual
(
mainpage
,
{
'Keys'
:
{
'default'
:
'False'
}})
self
.
assertEqual
(
mainpage
,
{
'Keys'
:
{
'default'
:
'False'
}})
eq
(
d
.
var_changed_builtin_name
.
called
,
1
)
eq
(
d
.
var_changed_builtin_name
.
called
,
1
)
...
@@ -847,15 +848,15 @@ class KeysPageTest(unittest.TestCase):
...
@@ -847,15 +848,15 @@ class KeysPageTest(unittest.TestCase):
d
.
set_keys_type
()
d
.
set_keys_type
()
eq
(
d
.
builtinlist
[
'state'
],
NORMAL
)
eq
(
d
.
builtinlist
[
'state'
],
NORMAL
)
eq
(
d
.
customlist
[
'state'
],
DISABLED
)
eq
(
d
.
customlist
[
'state'
],
DISABLED
)
eq
(
d
.
button_delete_custom_keys
[
'state'
],
DISABLED
)
eq
(
d
.
button_delete_custom_keys
.
state
(),
(
'disabled'
,)
)
# Custom keyset selected.
# Custom keyset selected.
d
.
keyset_source
.
set
(
False
)
d
.
keyset_source
.
set
(
False
)
d
.
set_keys_type
()
d
.
set_keys_type
()
eq
(
d
.
builtinlist
[
'state'
],
DISABLED
)
eq
(
d
.
builtinlist
[
'state'
],
DISABLED
)
eq
(
d
.
custom_keyset_on
[
'state'
],
NORMAL
)
eq
(
d
.
custom_keyset_on
.
state
(),
(
'selected'
,)
)
eq
(
d
.
customlist
[
'state'
],
NORMAL
)
eq
(
d
.
customlist
[
'state'
],
NORMAL
)
eq
(
d
.
button_delete_custom_keys
[
'state'
],
NORMAL
)
eq
(
d
.
button_delete_custom_keys
.
state
(),
()
)
d
.
set_keys_type
=
Func
()
d
.
set_keys_type
=
Func
()
def
test_get_new_keys
(
self
):
def
test_get_new_keys
(
self
):
...
@@ -865,7 +866,7 @@ class KeysPageTest(unittest.TestCase):
...
@@ -865,7 +866,7 @@ class KeysPageTest(unittest.TestCase):
gkd
=
configdialog
.
GetKeysDialog
=
Func
(
return_self
=
True
)
gkd
=
configdialog
.
GetKeysDialog
=
Func
(
return_self
=
True
)
gnkn
=
d
.
get_new_keys_name
=
Func
()
gnkn
=
d
.
get_new_keys_name
=
Func
()
d
.
button_new_keys
[
'state'
]
=
NORMAL
d
.
button_new_keys
.
state
((
'!disabled'
,))
d
.
bindingslist
.
delete
(
0
,
'end'
)
d
.
bindingslist
.
delete
(
0
,
'end'
)
d
.
bindingslist
.
insert
(
0
,
'copy - <Control-Shift-Key-C>'
)
d
.
bindingslist
.
insert
(
0
,
'copy - <Control-Shift-Key-C>'
)
d
.
bindingslist
.
selection_set
(
0
)
d
.
bindingslist
.
selection_set
(
0
)
...
@@ -953,7 +954,7 @@ class KeysPageTest(unittest.TestCase):
...
@@ -953,7 +954,7 @@ class KeysPageTest(unittest.TestCase):
b
.
event_generate
(
'<Button-1>'
,
x
=
x
,
y
=
y
)
b
.
event_generate
(
'<Button-1>'
,
x
=
x
,
y
=
y
)
b
.
event_generate
(
'<ButtonRelease-1>'
,
x
=
x
,
y
=
y
)
b
.
event_generate
(
'<ButtonRelease-1>'
,
x
=
x
,
y
=
y
)
self
.
assertEqual
(
b
.
get
(
'anchor'
),
'find'
)
self
.
assertEqual
(
b
.
get
(
'anchor'
),
'find'
)
self
.
assertEqual
(
d
.
button_new_keys
[
'state'
],
NORMAL
)
self
.
assertEqual
(
d
.
button_new_keys
.
state
(),
()
)
def
test_create_new_key_set_and_save_new_key_set
(
self
):
def
test_create_new_key_set_and_save_new_key_set
(
self
):
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
...
@@ -1032,7 +1033,7 @@ class KeysPageTest(unittest.TestCase):
...
@@ -1032,7 +1033,7 @@ class KeysPageTest(unittest.TestCase):
def
test_delete_custom_keys
(
self
):
def
test_delete_custom_keys
(
self
):
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
d
=
self
.
page
d
=
self
.
page
d
.
button_delete_custom_keys
[
'state'
]
=
NORMAL
d
.
button_delete_custom_keys
.
state
((
'!disabled'
,))
yesno
=
configdialog
.
tkMessageBox
.
askyesno
=
Func
()
yesno
=
configdialog
.
tkMessageBox
.
askyesno
=
Func
()
dialog
.
deactivate_current_config
=
Func
()
dialog
.
deactivate_current_config
=
Func
()
dialog
.
activate_config_changes
=
Func
()
dialog
.
activate_config_changes
=
Func
()
...
@@ -1061,7 +1062,7 @@ class KeysPageTest(unittest.TestCase):
...
@@ -1061,7 +1062,7 @@ class KeysPageTest(unittest.TestCase):
eq
(
yesno
.
called
,
2
)
eq
(
yesno
.
called
,
2
)
self
.
assertNotIn
(
keyset_name
,
keyspage
)
self
.
assertNotIn
(
keyset_name
,
keyspage
)
eq
(
idleConf
.
GetSectionList
(
'user'
,
'keys'
),
[])
eq
(
idleConf
.
GetSectionList
(
'user'
,
'keys'
),
[])
eq
(
d
.
custom_keyset_on
[
'state'
],
DISABLED
)
eq
(
d
.
custom_keyset_on
.
state
(),
(
'disabled'
,)
)
eq
(
d
.
custom_name
.
get
(),
'- no custom keys -'
)
eq
(
d
.
custom_name
.
get
(),
'- no custom keys -'
)
eq
(
dialog
.
deactivate_current_config
.
called
,
1
)
eq
(
dialog
.
deactivate_current_config
.
called
,
1
)
eq
(
dialog
.
activate_config_changes
.
called
,
1
)
eq
(
dialog
.
activate_config_changes
.
called
,
1
)
...
@@ -1173,18 +1174,18 @@ class GenPageTest(unittest.TestCase):
...
@@ -1173,18 +1174,18 @@ class GenPageTest(unittest.TestCase):
h
.
delete
(
0
,
'end'
)
h
.
delete
(
0
,
'end'
)
sad
()
sad
()
eq
(
d
.
button_helplist_edit
[
'state'
],
DISABLED
)
eq
(
d
.
button_helplist_edit
.
state
(),
(
'disabled'
,)
)
eq
(
d
.
button_helplist_remove
[
'state'
],
DISABLED
)
eq
(
d
.
button_helplist_remove
.
state
(),
(
'disabled'
,)
)
h
.
insert
(
0
,
'source'
)
h
.
insert
(
0
,
'source'
)
sad
()
sad
()
eq
(
d
.
button_helplist_edit
[
'state'
],
DISABLED
)
eq
(
d
.
button_helplist_edit
.
state
(),
(
'disabled'
,)
)
eq
(
d
.
button_helplist_remove
[
'state'
],
DISABLED
)
eq
(
d
.
button_helplist_remove
.
state
(),
(
'disabled'
,)
)
h
.
selection_set
(
0
)
h
.
selection_set
(
0
)
sad
()
sad
()
eq
(
d
.
button_helplist_edit
[
'state'
],
NORMAL
)
eq
(
d
.
button_helplist_edit
.
state
(),
()
)
eq
(
d
.
button_helplist_remove
[
'state'
],
NORMAL
)
eq
(
d
.
button_helplist_remove
.
state
(),
()
)
d
.
set_add_delete_state
=
Func
()
# Mask method.
d
.
set_add_delete_state
=
Func
()
# Mask method.
def
test_helplist_item_add
(
self
):
def
test_helplist_item_add
(
self
):
...
...
Misc/NEWS.d/next/IDLE/2017-07-28-18-59-06.bpo-30781.ud5m18.rst
View file @
7028e598
IDLE - Use ttk Notebook in ConfigDialog
IDLE - Use ttk widgets in ConfigDialog.
Patches by Terry Jan Reedy and Cheryl Sabella.
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