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
848972ca
Kaydet (Commit)
848972ca
authored
Ara 25, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19020: Tkinter now uses splitlist() instead of split() in configure
methods.
üst
0fd55764
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
54 deletions
+34
-54
__init__.py
Lib/tkinter/__init__.py
+19
-18
widget_tests.py
Lib/tkinter/test/widget_tests.py
+1
-3
tix.py
Lib/tkinter/tix.py
+11
-33
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/tkinter/__init__.py
Dosyayı görüntüle @
848972ca
...
...
@@ -1235,6 +1235,19 @@ class Misc:
exc
,
val
,
tb
=
sys
.
exc_info
()
root
=
self
.
_root
()
root
.
report_callback_exception
(
exc
,
val
,
tb
)
def
_getconfigure
(
self
,
*
args
):
"""Call Tcl configure command and return the result as a dict."""
cnf
=
{}
for
x
in
self
.
tk
.
splitlist
(
self
.
tk
.
call
(
*
args
)):
x
=
self
.
tk
.
splitlist
(
x
)
cnf
[
x
[
0
][
1
:]]
=
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
cnf
def
_getconfigure1
(
self
,
*
args
):
x
=
self
.
tk
.
splitlist
(
self
.
tk
.
call
(
*
args
))
return
(
x
[
0
][
1
:],)
+
x
[
1
:]
def
_configure
(
self
,
cmd
,
cnf
,
kw
):
"""Internal function."""
if
kw
:
...
...
@@ -1242,15 +1255,9 @@ class Misc:
elif
cnf
:
cnf
=
_cnfmerge
(
cnf
)
if
cnf
is
None
:
cnf
=
{}
for
x
in
self
.
tk
.
split
(
self
.
tk
.
call
(
_flatten
((
self
.
_w
,
cmd
)))):
cnf
[
x
[
0
][
1
:]]
=
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
cnf
return
self
.
_getconfigure
(
_flatten
((
self
.
_w
,
cmd
)))
if
isinstance
(
cnf
,
str
):
x
=
self
.
tk
.
split
(
self
.
tk
.
call
(
_flatten
((
self
.
_w
,
cmd
,
'-'
+
cnf
))))
return
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
self
.
_getconfigure1
(
_flatten
((
self
.
_w
,
cmd
,
'-'
+
cnf
)))
self
.
tk
.
call
(
_flatten
((
self
.
_w
,
cmd
))
+
self
.
_options
(
cnf
))
# These used to be defined in Widget:
def
configure
(
self
,
cnf
=
None
,
**
kw
):
...
...
@@ -1271,7 +1278,7 @@ class Misc:
def
keys
(
self
):
"""Return a list of all resource names of this widget."""
return
[
x
[
0
][
1
:]
for
x
in
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
))]
self
.
tk
.
split
list
(
self
.
tk
.
call
(
self
.
_w
,
'configure'
))]
def
__str__
(
self
):
"""Return the window path name of this widget."""
return
self
.
_w
...
...
@@ -3825,16 +3832,10 @@ class PanedWindow(Widget):
"""
if
cnf
is
None
and
not
kw
:
cnf
=
{}
for
x
in
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'paneconfigure'
,
tagOrId
)):
cnf
[
x
[
0
][
1
:]]
=
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
cnf
return
self
.
_getconfigure
(
self
.
_w
,
'paneconfigure'
,
tagOrId
)
if
isinstance
(
cnf
,
str
)
and
not
kw
:
x
=
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'paneconfigure'
,
tagOrId
,
'-'
+
cnf
))
return
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
self
.
_getconfigure1
(
self
.
_w
,
'paneconfigure'
,
tagOrId
,
'-'
+
cnf
)
self
.
tk
.
call
((
self
.
_w
,
'paneconfigure'
,
tagOrId
)
+
self
.
_options
(
cnf
,
kw
))
paneconfig
=
paneconfigure
...
...
Lib/tkinter/test/widget_tests.py
Dosyayı görüntüle @
848972ca
...
...
@@ -62,9 +62,7 @@ class AbstractWidgetTest:
if
not
isinstance
(
widget
,
Scale
):
t
=
widget
.
configure
(
name
)
self
.
assertEqual
(
len
(
t
),
5
)
## XXX
if
not
isinstance
(
t
[
4
],
tuple
):
self
.
assertEqual2
(
t
[
4
],
expected
,
eq
=
eq
)
self
.
assertEqual2
(
t
[
4
],
expected
,
eq
=
eq
)
def
checkInvalidParam
(
self
,
widget
,
name
,
value
,
errmsg
=
None
,
*
,
keep_orig
=
True
):
...
...
Lib/tkinter/tix.py
Dosyayı görüntüle @
848972ca
...
...
@@ -122,13 +122,9 @@ class tixCommand:
elif
cnf
:
cnf
=
_cnfmerge
(
cnf
)
if
cnf
is
None
:
cnf
=
{}
for
x
in
self
.
tk
.
split
(
self
.
tk
.
call
(
'tix'
,
'configure'
)):
cnf
[
x
[
0
][
1
:]]
=
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
cnf
return
self
.
_getconfigure
(
'tix'
,
'configure'
)
if
isinstance
(
cnf
,
str
):
x
=
self
.
tk
.
split
(
self
.
tk
.
call
(
'tix'
,
'configure'
,
'-'
+
cnf
))
return
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
self
.
_getconfigure1
(
'tix'
,
'configure'
,
'-'
+
cnf
)
return
self
.
tk
.
call
((
'tix'
,
'configure'
)
+
self
.
_options
(
cnf
))
def
tix_filedialog
(
self
,
dlgclass
=
None
):
...
...
@@ -380,7 +376,7 @@ class TixWidget(tkinter.Widget):
"""Return the name of all subwidgets."""
try
:
x
=
self
.
tk
.
call
(
self
.
_w
,
'subwidgets'
,
'-all'
)
return
self
.
tk
.
split
(
x
)
return
self
.
tk
.
split
list
(
x
)
except
TclError
:
return
None
...
...
@@ -473,13 +469,6 @@ class TixSubWidget(TixWidget):
self
.
tk
.
call
(
'destroy'
,
self
.
_w
)
# Useful func. to split Tcl lists and return as a dict. From Tkinter.py
def
_lst2dict
(
lst
):
dict
=
{}
for
x
in
lst
:
dict
[
x
[
0
][
1
:]]
=
(
x
[
0
][
1
:],)
+
x
[
1
:]
return
dict
# Useful class to create a display style - later shared by many items.
# Contributed by Steffen Kremser
class
DisplayStyle
:
...
...
@@ -515,10 +504,8 @@ class DisplayStyle:
self
.
tk
.
call
(
self
.
stylename
,
'configure'
,
'-
%
s'
%
key
,
value
)
def
config
(
self
,
cnf
=
{},
**
kw
):
return
_lst2dict
(
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
stylename
,
'configure'
,
*
self
.
_options
(
cnf
,
kw
))))
return
self
.
_getconfigure
(
self
.
stylename
,
'configure'
,
*
self
.
_options
(
cnf
,
kw
))
def
__getitem__
(
self
,
key
):
return
self
.
tk
.
call
(
self
.
stylename
,
'cget'
,
'-
%
s'
%
key
)
...
...
@@ -928,9 +915,7 @@ class HList(TixWidget, XView, YView):
def
header_configure
(
self
,
col
,
cnf
=
{},
**
kw
):
if
cnf
is
None
:
return
_lst2dict
(
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'header'
,
'configure'
,
col
)))
return
self
.
_getconfigure
(
self
.
_w
,
'header'
,
'configure'
,
col
)
self
.
tk
.
call
(
self
.
_w
,
'header'
,
'configure'
,
col
,
*
self
.
_options
(
cnf
,
kw
))
...
...
@@ -955,9 +940,8 @@ class HList(TixWidget, XView, YView):
def
indicator_configure
(
self
,
entry
,
cnf
=
{},
**
kw
):
if
cnf
is
None
:
return
_lst2dict
(
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'indicator'
,
'configure'
,
entry
)))
return
self
.
_getconfigure
(
self
.
_w
,
'indicator'
,
'configure'
,
entry
)
self
.
tk
.
call
(
self
.
_w
,
'indicator'
,
'configure'
,
entry
,
*
self
.
_options
(
cnf
,
kw
))
...
...
@@ -1017,9 +1001,7 @@ class HList(TixWidget, XView, YView):
def
item_configure
(
self
,
entry
,
col
,
cnf
=
{},
**
kw
):
if
cnf
is
None
:
return
_lst2dict
(
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'item'
,
'configure'
,
entry
,
col
)))
return
self
.
_getconfigure
(
self
.
_w
,
'item'
,
'configure'
,
entry
,
col
)
self
.
tk
.
call
(
self
.
_w
,
'item'
,
'configure'
,
entry
,
col
,
*
self
.
_options
(
cnf
,
kw
))
...
...
@@ -1038,9 +1020,7 @@ class HList(TixWidget, XView, YView):
def
entryconfigure
(
self
,
entry
,
cnf
=
{},
**
kw
):
if
cnf
is
None
:
return
_lst2dict
(
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'entryconfigure'
,
entry
)))
return
self
.
_getconfigure
(
self
.
_w
,
'entryconfigure'
,
entry
)
self
.
tk
.
call
(
self
.
_w
,
'entryconfigure'
,
entry
,
*
self
.
_options
(
cnf
,
kw
))
...
...
@@ -1254,9 +1234,7 @@ class PanedWindow(TixWidget):
def
paneconfigure
(
self
,
entry
,
cnf
=
{},
**
kw
):
if
cnf
is
None
:
return
_lst2dict
(
self
.
tk
.
split
(
self
.
tk
.
call
(
self
.
_w
,
'paneconfigure'
,
entry
)))
return
self
.
_getconfigure
(
self
.
_w
,
'paneconfigure'
,
entry
)
self
.
tk
.
call
(
self
.
_w
,
'paneconfigure'
,
entry
,
*
self
.
_options
(
cnf
,
kw
))
def
panes
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
848972ca
...
...
@@ -29,6 +29,9 @@ Core and Builtins
Library
-------
- Issue #19020: Tkinter now uses splitlist() instead of split() in configure
methods.
- Fix TypeError on "setup.py upload --show-response".
- Issue #12226: HTTPS is now used by default when connecting to PyPI.
...
...
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