Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
44913e58
Kaydet (Commit)
44913e58
authored
Haz 27, 2017
tarafından
terryjreedy
Kaydeden (comit)
GitHub
Haz 27, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-21519: IDLE basic custom key entry better detects duplicates. (#2428)
üst
213ce12a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
config_key.py
Lib/idlelib/config_key.py
+3
-3
test_config_key.py
Lib/idlelib/idle_test/test_config_key.py
+10
-4
2017-06-27-00-29-56.bpo-21519.fTj9T0.rst
...NEWS.d/next/IDLE/2017-06-27-00-29-56.bpo-21519.fTj9T0.rst
+2
-0
No files found.
Lib/idlelib/config_key.py
Dosyayı görüntüle @
44913e58
...
...
@@ -250,10 +250,10 @@ class GetKeysDialog(Toplevel):
'''
finalKey
=
self
.
listKeysFinal
.
get
(
ANCHOR
)
modifiers
=
self
.
GetModifiers
()
# create a key sequence list for overlap check:
keySequence
=
keys
.
split
()
keysOK
=
False
title
=
self
.
keyerror_title
key_sequences
=
[
key
for
keylist
in
self
.
currentKeySequences
for
key
in
keylist
]
if
not
keys
.
endswith
(
'>'
):
self
.
showerror
(
title
,
parent
=
self
,
message
=
'Missing the final Key'
)
...
...
@@ -267,7 +267,7 @@ class GetKeysDialog(Toplevel):
msg
=
'The shift modifier by itself may not be used with'
\
' this key symbol.'
self
.
showerror
(
title
=
title
,
parent
=
self
,
message
=
msg
)
elif
key
Sequence
in
self
.
currentKeyS
equences
:
elif
key
s
in
key_s
equences
:
msg
=
'This key combination is already in use.'
self
.
showerror
(
title
=
title
,
parent
=
self
,
message
=
msg
)
else
:
...
...
Lib/idlelib/idle_test/test_config_key.py
Dosyayı görüntüle @
44913e58
...
...
@@ -28,8 +28,9 @@ class ValidationTest(unittest.TestCase):
requires
(
'gui'
)
cls
.
root
=
Tk
()
cls
.
root
.
withdraw
()
keylist
=
[[
'<Key-F12>'
],
[
'<Control-Key-x>'
,
'<Control-Key-X>'
]]
cls
.
dialog
=
cls
.
Validator
(
cls
.
root
,
'Title'
,
'<<Test>>'
,
[[
'<Key-F12>'
]]
,
_utest
=
True
)
cls
.
root
,
'Title'
,
'<<Test>>'
,
keylist
,
_utest
=
True
)
@classmethod
def
tearDownClass
(
cls
):
...
...
@@ -78,10 +79,15 @@ class ValidationTest(unittest.TestCase):
self
.
dialog
.
GetModifiers
.
result
=
[]
def
test_keys_dup
(
self
):
self
.
dialog
.
listKeysFinal
.
get
.
result
=
'F12'
for
mods
,
final
,
seq
in
(([],
'F12'
,
'<Key-F12>'
),
([
'Control'
],
'x'
,
'<Control-Key-x>'
),
([
'Control'
],
'X'
,
'<Control-Key-X>'
)):
with
self
.
subTest
(
m
=
mods
,
f
=
final
,
s
=
seq
):
self
.
dialog
.
listKeysFinal
.
get
.
result
=
final
self
.
dialog
.
GetModifiers
.
result
=
mods
self
.
assertFalse
(
self
.
dialog
.
KeysOK
(
seq
))
self
.
assertIn
(
'already in use'
,
self
.
dialog
.
showerror
.
message
)
self
.
dialog
.
GetModifiers
.
result
=
[]
self
.
assertFalse
(
self
.
dialog
.
KeysOK
(
'<Key-F12>'
))
self
.
assertIn
(
'already in use'
,
self
.
dialog
.
showerror
.
message
)
def
test_bind_ok
(
self
):
self
.
assertTrue
(
self
.
dialog
.
bind_ok
(
'<Control-Shift-Key-a>'
))
...
...
Misc/NEWS.d/next/IDLE/2017-06-27-00-29-56.bpo-21519.fTj9T0.rst
0 → 100644
Dosyayı görüntüle @
44913e58
IDLE's basic custom key entry dialog now detects duplicates properly.
Original patch by Saimadhav Heblikar.
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