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
2d68f186
Kaydet (Commit)
2d68f186
authored
Mar 09, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets.
üst
b9f3114d
42a4366a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
4 deletions
+49
-4
__init__.py
Lib/tkinter/__init__.py
+3
-2
test_geometry_managers.py
Lib/tkinter/test/test_tkinter/test_geometry_managers.py
+6
-0
test_widgets.py
Lib/tkinter/test/test_tkinter/test_widgets.py
+11
-2
test_widgets.py
Lib/tkinter/test/test_ttk/test_widgets.py
+0
-0
widget_tests.py
Lib/tkinter/test/widget_tests.py
+27
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/tkinter/__init__.py
Dosyayı görüntüle @
2d68f186
...
@@ -1336,8 +1336,9 @@ class Misc:
...
@@ -1336,8 +1336,9 @@ class Misc:
self
.
configure
({
key
:
value
})
self
.
configure
({
key
:
value
})
def
keys
(
self
):
def
keys
(
self
):
"""Return a list of all resource names of this widget."""
"""Return a list of all resource names of this widget."""
return
[
x
[
0
][
1
:]
for
x
in
splitlist
=
self
.
tk
.
splitlist
self
.
tk
.
splitlist
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
))]
return
[
splitlist
(
x
)[
0
][
1
:]
for
x
in
splitlist
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
))]
def
__str__
(
self
):
def
__str__
(
self
):
"""Return the window path name of this widget."""
"""Return the window path name of this widget."""
return
self
.
_w
return
self
.
_w
...
...
Lib/tkinter/test/test_tkinter/test_geometry_managers.py
Dosyayı görüntüle @
2d68f186
...
@@ -12,6 +12,8 @@ requires('gui')
...
@@ -12,6 +12,8 @@ requires('gui')
class
PackTest
(
AbstractWidgetTest
,
unittest
.
TestCase
):
class
PackTest
(
AbstractWidgetTest
,
unittest
.
TestCase
):
test_keys
=
None
def
create2
(
self
):
def
create2
(
self
):
pack
=
tkinter
.
Toplevel
(
self
.
root
,
name
=
'pack'
)
pack
=
tkinter
.
Toplevel
(
self
.
root
,
name
=
'pack'
)
pack
.
wm_geometry
(
'300x200+0+0'
)
pack
.
wm_geometry
(
'300x200+0+0'
)
...
@@ -276,6 +278,8 @@ class PackTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -276,6 +278,8 @@ class PackTest(AbstractWidgetTest, unittest.TestCase):
class
PlaceTest
(
AbstractWidgetTest
,
unittest
.
TestCase
):
class
PlaceTest
(
AbstractWidgetTest
,
unittest
.
TestCase
):
test_keys
=
None
def
create2
(
self
):
def
create2
(
self
):
t
=
tkinter
.
Toplevel
(
self
.
root
,
width
=
300
,
height
=
200
,
bd
=
0
)
t
=
tkinter
.
Toplevel
(
self
.
root
,
width
=
300
,
height
=
200
,
bd
=
0
)
t
.
wm_geometry
(
'300x200+0+0'
)
t
.
wm_geometry
(
'300x200+0+0'
)
...
@@ -478,6 +482,8 @@ class PlaceTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -478,6 +482,8 @@ class PlaceTest(AbstractWidgetTest, unittest.TestCase):
class
GridTest
(
AbstractWidgetTest
,
unittest
.
TestCase
):
class
GridTest
(
AbstractWidgetTest
,
unittest
.
TestCase
):
test_keys
=
None
def
tearDown
(
self
):
def
tearDown
(
self
):
cols
,
rows
=
self
.
root
.
grid_size
()
cols
,
rows
=
self
.
root
.
grid_size
()
for
i
in
range
(
cols
+
1
):
for
i
in
range
(
cols
+
1
):
...
...
Lib/tkinter/test/test_tkinter/test_widgets.py
Dosyayı görüntüle @
2d68f186
...
@@ -103,7 +103,7 @@ class FrameTest(AbstractToplevelTest, unittest.TestCase):
...
@@ -103,7 +103,7 @@ class FrameTest(AbstractToplevelTest, unittest.TestCase):
'background'
,
'borderwidth'
,
'background'
,
'borderwidth'
,
'class'
,
'colormap'
,
'container'
,
'cursor'
,
'height'
,
'class'
,
'colormap'
,
'container'
,
'cursor'
,
'height'
,
'highlightbackground'
,
'highlightcolor'
,
'highlightthickness'
,
'highlightbackground'
,
'highlightcolor'
,
'highlightthickness'
,
'relief'
,
'takefocus'
,
'visual'
,
'width'
,
'
padx'
,
'pady'
,
'
relief'
,
'takefocus'
,
'visual'
,
'width'
,
)
)
def
create
(
self
,
**
kwargs
):
def
create
(
self
,
**
kwargs
):
...
@@ -637,7 +637,7 @@ class CanvasTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -637,7 +637,7 @@ class CanvasTest(AbstractWidgetTest, unittest.TestCase):
'highlightbackground'
,
'highlightcolor'
,
'highlightthickness'
,
'highlightbackground'
,
'highlightcolor'
,
'highlightthickness'
,
'insertbackground'
,
'insertborderwidth'
,
'insertbackground'
,
'insertborderwidth'
,
'insertofftime'
,
'insertontime'
,
'insertwidth'
,
'insertofftime'
,
'insertontime'
,
'insertwidth'
,
'relief'
,
'scrollregion'
,
'
offset'
,
'
relief'
,
'scrollregion'
,
'selectbackground'
,
'selectborderwidth'
,
'selectforeground'
,
'selectbackground'
,
'selectborderwidth'
,
'selectforeground'
,
'state'
,
'takefocus'
,
'state'
,
'takefocus'
,
'xscrollcommand'
,
'xscrollincrement'
,
'xscrollcommand'
,
'xscrollincrement'
,
...
@@ -659,6 +659,15 @@ class CanvasTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -659,6 +659,15 @@ class CanvasTest(AbstractWidgetTest, unittest.TestCase):
widget
=
self
.
create
()
widget
=
self
.
create
()
self
.
checkBooleanParam
(
widget
,
'confine'
)
self
.
checkBooleanParam
(
widget
,
'confine'
)
def
test_offset
(
self
):
widget
=
self
.
create
()
self
.
assertEqual
(
widget
[
'offset'
],
'0,0'
)
self
.
checkParams
(
widget
,
'offset'
,
'n'
,
'ne'
,
'e'
,
'se'
,
's'
,
'sw'
,
'w'
,
'nw'
,
'center'
)
self
.
checkParam
(
widget
,
'offset'
,
'10,20'
)
self
.
checkParam
(
widget
,
'offset'
,
'#5,6'
)
self
.
checkInvalidParam
(
widget
,
'offset'
,
'spam'
)
def
test_scrollregion
(
self
):
def
test_scrollregion
(
self
):
widget
=
self
.
create
()
widget
=
self
.
create
()
self
.
checkParam
(
widget
,
'scrollregion'
,
'0 0 200 150'
)
self
.
checkParam
(
widget
,
'scrollregion'
,
'0 0 200 150'
)
...
...
Lib/tkinter/test/test_ttk/test_widgets.py
Dosyayı görüntüle @
2d68f186
This diff is collapsed.
Click to expand it.
Lib/tkinter/test/widget_tests.py
Dosyayı görüntüle @
2d68f186
...
@@ -206,6 +206,33 @@ class AbstractWidgetTest(AbstractTkTest):
...
@@ -206,6 +206,33 @@ class AbstractWidgetTest(AbstractTkTest):
break
break
def
test_keys
(
self
):
widget
=
self
.
create
()
keys
=
widget
.
keys
()
# XXX
if
not
isinstance
(
widget
,
Scale
):
self
.
assertEqual
(
sorted
(
keys
),
sorted
(
widget
.
configure
()))
for
k
in
keys
:
widget
[
k
]
# Test if OPTIONS contains all keys
if
test
.
support
.
verbose
:
aliases
=
{
'bd'
:
'borderwidth'
,
'bg'
:
'background'
,
'fg'
:
'foreground'
,
'invcmd'
:
'invalidcommand'
,
'vcmd'
:
'validatecommand'
,
}
keys
=
set
(
keys
)
expected
=
set
(
self
.
OPTIONS
)
for
k
in
sorted
(
keys
-
expected
):
if
not
(
k
in
aliases
and
aliases
[
k
]
in
keys
and
aliases
[
k
]
in
expected
):
print
(
'
%
s.OPTIONS doesn
\'
t contain "
%
s"'
%
(
self
.
__class__
.
__name__
,
k
))
class
StandardOptionsTests
:
class
StandardOptionsTests
:
STANDARD_OPTIONS
=
(
STANDARD_OPTIONS
=
(
'activebackground'
,
'activeborderwidth'
,
'activeforeground'
,
'anchor'
,
'activebackground'
,
'activeborderwidth'
,
'activeforeground'
,
'anchor'
,
...
...
Misc/NEWS
Dosyayı görüntüle @
2d68f186
...
@@ -201,6 +201,8 @@ Core and Builtins
...
@@ -201,6 +201,8 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
26177
:
Fixed
the
keys
()
method
for
Canvas
and
Scrollbar
widgets
.
-
Issue
#
21042
:
Make
ctypes
.
util
.
find_library
()
return
the
full
path
on
-
Issue
#
21042
:
Make
ctypes
.
util
.
find_library
()
return
the
full
path
on
Linux
,
similar
to
other
platforms
.
Patch
by
Tam
á
s
Bence
Gedai
.
Linux
,
similar
to
other
platforms
.
Patch
by
Tam
á
s
Bence
Gedai
.
...
...
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