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
dc0d571b
Unverified
Kaydet (Commit)
dc0d571b
authored
Eki 12, 2018
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Eki 12, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822)
üst
2d6097d0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
5 deletions
+32
-5
__init__.py
Lib/tkinter/__init__.py
+0
-0
commondialog.py
Lib/tkinter/commondialog.py
+1
-0
dialog.py
Lib/tkinter/dialog.py
+2
-0
dnd.py
Lib/tkinter/dnd.py
+3
-1
filedialog.py
Lib/tkinter/filedialog.py
+8
-2
messagebox.py
Lib/tkinter/messagebox.py
+8
-0
scrolledtext.py
Lib/tkinter/scrolledtext.py
+2
-0
simpledialog.py
Lib/tkinter/simpledialog.py
+8
-2
No files found.
Lib/tkinter/__init__.py
Dosyayı görüntüle @
dc0d571b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Lib/tkinter/commondialog.py
Dosyayı görüntüle @
dc0d571b
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
from
tkinter
import
*
from
tkinter
import
*
class
Dialog
:
class
Dialog
:
command
=
None
command
=
None
...
...
Lib/tkinter/dialog.py
Dosyayı görüntüle @
dc0d571b
...
@@ -19,8 +19,10 @@ class Dialog(Widget):
...
@@ -19,8 +19,10 @@ class Dialog(Widget):
*
cnf
[
'strings'
]))
*
cnf
[
'strings'
]))
try
:
Widget
.
destroy
(
self
)
try
:
Widget
.
destroy
(
self
)
except
TclError
:
pass
except
TclError
:
pass
def
destroy
(
self
):
pass
def
destroy
(
self
):
pass
def
_test
():
def
_test
():
d
=
Dialog
(
None
,
{
'title'
:
'File Modified'
,
d
=
Dialog
(
None
,
{
'title'
:
'File Modified'
,
'text'
:
'text'
:
...
...
Lib/tkinter/dnd.py
Dosyayı görüntüle @
dc0d571b
...
@@ -201,7 +201,6 @@ class DndHandler:
...
@@ -201,7 +201,6 @@ class DndHandler:
source
.
dnd_end
(
target
,
event
)
source
.
dnd_end
(
target
,
event
)
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# The rest is here for testing and demonstration purposes only!
# The rest is here for testing and demonstration purposes only!
...
@@ -265,6 +264,7 @@ class Icon:
...
@@ -265,6 +264,7 @@ class Icon:
def
dnd_end
(
self
,
target
,
event
):
def
dnd_end
(
self
,
target
,
event
):
pass
pass
class
Tester
:
class
Tester
:
def
__init__
(
self
,
root
):
def
__init__
(
self
,
root
):
...
@@ -299,6 +299,7 @@ class Tester:
...
@@ -299,6 +299,7 @@ class Tester:
x
,
y
=
source
.
where
(
self
.
canvas
,
event
)
x
,
y
=
source
.
where
(
self
.
canvas
,
event
)
source
.
attach
(
self
.
canvas
,
x
,
y
)
source
.
attach
(
self
.
canvas
,
x
,
y
)
def
test
():
def
test
():
root
=
tkinter
.
Tk
()
root
=
tkinter
.
Tk
()
root
.
geometry
(
"+1+1"
)
root
.
geometry
(
"+1+1"
)
...
@@ -317,5 +318,6 @@ def test():
...
@@ -317,5 +318,6 @@ def test():
i3
.
attach
(
t3
.
canvas
)
i3
.
attach
(
t3
.
canvas
)
root
.
mainloop
()
root
.
mainloop
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test
()
test
()
Lib/tkinter/filedialog.py
Dosyayı görüntüle @
dc0d571b
...
@@ -264,7 +264,6 @@ class SaveFileDialog(FileDialog):
...
@@ -264,7 +264,6 @@ class SaveFileDialog(FileDialog):
self
.
quit
(
file
)
self
.
quit
(
file
)
# For the following classes and modules:
# For the following classes and modules:
#
#
# options (all have default values):
# options (all have default values):
...
@@ -341,6 +340,7 @@ class Open(_Dialog):
...
@@ -341,6 +340,7 @@ class Open(_Dialog):
return
self
.
_fixresult
(
widget
,
widget
.
tk
.
splitlist
(
result
))
return
self
.
_fixresult
(
widget
,
widget
.
tk
.
splitlist
(
result
))
return
_Dialog
.
_fixresult
(
self
,
widget
,
result
)
return
_Dialog
.
_fixresult
(
self
,
widget
,
result
)
class
SaveAs
(
_Dialog
):
class
SaveAs
(
_Dialog
):
"Ask for a filename to save as"
"Ask for a filename to save as"
...
@@ -369,16 +369,19 @@ class Directory(commondialog.Dialog):
...
@@ -369,16 +369,19 @@ class Directory(commondialog.Dialog):
#
#
# convenience stuff
# convenience stuff
def
askopenfilename
(
**
options
):
def
askopenfilename
(
**
options
):
"Ask for a filename to open"
"Ask for a filename to open"
return
Open
(
**
options
)
.
show
()
return
Open
(
**
options
)
.
show
()
def
asksaveasfilename
(
**
options
):
def
asksaveasfilename
(
**
options
):
"Ask for a filename to save as"
"Ask for a filename to save as"
return
SaveAs
(
**
options
)
.
show
()
return
SaveAs
(
**
options
)
.
show
()
def
askopenfilenames
(
**
options
):
def
askopenfilenames
(
**
options
):
"""Ask for multiple filenames to open
"""Ask for multiple filenames to open
...
@@ -390,6 +393,7 @@ def askopenfilenames(**options):
...
@@ -390,6 +393,7 @@ def askopenfilenames(**options):
# FIXME: are the following perhaps a bit too convenient?
# FIXME: are the following perhaps a bit too convenient?
def
askopenfile
(
mode
=
"r"
,
**
options
):
def
askopenfile
(
mode
=
"r"
,
**
options
):
"Ask for a filename to open, and returned the opened file"
"Ask for a filename to open, and returned the opened file"
...
@@ -398,6 +402,7 @@ def askopenfile(mode = "r", **options):
...
@@ -398,6 +402,7 @@ def askopenfile(mode = "r", **options):
return
open
(
filename
,
mode
)
return
open
(
filename
,
mode
)
return
None
return
None
def
askopenfiles
(
mode
=
"r"
,
**
options
):
def
askopenfiles
(
mode
=
"r"
,
**
options
):
"""Ask for multiple filenames and return the open file
"""Ask for multiple filenames and return the open file
objects
objects
...
@@ -423,12 +428,12 @@ def asksaveasfile(mode = "w", **options):
...
@@ -423,12 +428,12 @@ def asksaveasfile(mode = "w", **options):
return
open
(
filename
,
mode
)
return
open
(
filename
,
mode
)
return
None
return
None
def
askdirectory
(
**
options
):
def
askdirectory
(
**
options
):
"Ask for a directory, and return the file name"
"Ask for a directory, and return the file name"
return
Directory
(
**
options
)
.
show
()
return
Directory
(
**
options
)
.
show
()
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# test stuff
# test stuff
...
@@ -475,5 +480,6 @@ def test():
...
@@ -475,5 +480,6 @@ def test():
saveasfilename
=
asksaveasfilename
()
saveasfilename
=
asksaveasfilename
()
print
(
"saveas"
,
saveasfilename
.
encode
(
enc
))
print
(
"saveas"
,
saveasfilename
.
encode
(
enc
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test
()
test
()
Lib/tkinter/messagebox.py
Dosyayı görüntüle @
dc0d571b
...
@@ -78,32 +78,39 @@ def _show(title=None, message=None, _icon=None, _type=None, **options):
...
@@ -78,32 +78,39 @@ def _show(title=None, message=None, _icon=None, _type=None, **options):
# In others we get a Tcl_Obj.
# In others we get a Tcl_Obj.
return
str
(
res
)
return
str
(
res
)
def
showinfo
(
title
=
None
,
message
=
None
,
**
options
):
def
showinfo
(
title
=
None
,
message
=
None
,
**
options
):
"Show an info message"
"Show an info message"
return
_show
(
title
,
message
,
INFO
,
OK
,
**
options
)
return
_show
(
title
,
message
,
INFO
,
OK
,
**
options
)
def
showwarning
(
title
=
None
,
message
=
None
,
**
options
):
def
showwarning
(
title
=
None
,
message
=
None
,
**
options
):
"Show a warning message"
"Show a warning message"
return
_show
(
title
,
message
,
WARNING
,
OK
,
**
options
)
return
_show
(
title
,
message
,
WARNING
,
OK
,
**
options
)
def
showerror
(
title
=
None
,
message
=
None
,
**
options
):
def
showerror
(
title
=
None
,
message
=
None
,
**
options
):
"Show an error message"
"Show an error message"
return
_show
(
title
,
message
,
ERROR
,
OK
,
**
options
)
return
_show
(
title
,
message
,
ERROR
,
OK
,
**
options
)
def
askquestion
(
title
=
None
,
message
=
None
,
**
options
):
def
askquestion
(
title
=
None
,
message
=
None
,
**
options
):
"Ask a question"
"Ask a question"
return
_show
(
title
,
message
,
QUESTION
,
YESNO
,
**
options
)
return
_show
(
title
,
message
,
QUESTION
,
YESNO
,
**
options
)
def
askokcancel
(
title
=
None
,
message
=
None
,
**
options
):
def
askokcancel
(
title
=
None
,
message
=
None
,
**
options
):
"Ask if operation should proceed; return true if the answer is ok"
"Ask if operation should proceed; return true if the answer is ok"
s
=
_show
(
title
,
message
,
QUESTION
,
OKCANCEL
,
**
options
)
s
=
_show
(
title
,
message
,
QUESTION
,
OKCANCEL
,
**
options
)
return
s
==
OK
return
s
==
OK
def
askyesno
(
title
=
None
,
message
=
None
,
**
options
):
def
askyesno
(
title
=
None
,
message
=
None
,
**
options
):
"Ask a question; return true if the answer is yes"
"Ask a question; return true if the answer is yes"
s
=
_show
(
title
,
message
,
QUESTION
,
YESNO
,
**
options
)
s
=
_show
(
title
,
message
,
QUESTION
,
YESNO
,
**
options
)
return
s
==
YES
return
s
==
YES
def
askyesnocancel
(
title
=
None
,
message
=
None
,
**
options
):
def
askyesnocancel
(
title
=
None
,
message
=
None
,
**
options
):
"Ask a question; return true if the answer is yes, None if cancelled."
"Ask a question; return true if the answer is yes, None if cancelled."
s
=
_show
(
title
,
message
,
QUESTION
,
YESNOCANCEL
,
**
options
)
s
=
_show
(
title
,
message
,
QUESTION
,
YESNOCANCEL
,
**
options
)
...
@@ -113,6 +120,7 @@ def askyesnocancel(title=None, message=None, **options):
...
@@ -113,6 +120,7 @@ def askyesnocancel(title=None, message=None, **options):
return
None
return
None
return
s
==
YES
return
s
==
YES
def
askretrycancel
(
title
=
None
,
message
=
None
,
**
options
):
def
askretrycancel
(
title
=
None
,
message
=
None
,
**
options
):
"Ask if operation should be retried; return true if the answer is yes"
"Ask if operation should be retried; return true if the answer is yes"
s
=
_show
(
title
,
message
,
WARNING
,
RETRYCANCEL
,
**
options
)
s
=
_show
(
title
,
message
,
WARNING
,
RETRYCANCEL
,
**
options
)
...
...
Lib/tkinter/scrolledtext.py
Dosyayı görüntüle @
dc0d571b
...
@@ -16,6 +16,7 @@ __all__ = ['ScrolledText']
...
@@ -16,6 +16,7 @@ __all__ = ['ScrolledText']
from
tkinter
import
Frame
,
Text
,
Scrollbar
,
Pack
,
Grid
,
Place
from
tkinter
import
Frame
,
Text
,
Scrollbar
,
Pack
,
Grid
,
Place
from
tkinter.constants
import
RIGHT
,
LEFT
,
Y
,
BOTH
from
tkinter.constants
import
RIGHT
,
LEFT
,
Y
,
BOTH
class
ScrolledText
(
Text
):
class
ScrolledText
(
Text
):
def
__init__
(
self
,
master
=
None
,
**
kw
):
def
__init__
(
self
,
master
=
None
,
**
kw
):
self
.
frame
=
Frame
(
master
)
self
.
frame
=
Frame
(
master
)
...
@@ -50,5 +51,6 @@ def example():
...
@@ -50,5 +51,6 @@ def example():
stext
.
focus_set
()
stext
.
focus_set
()
stext
.
mainloop
()
stext
.
mainloop
()
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
example
()
example
()
Lib/tkinter/simpledialog.py
Dosyayı görüntüle @
dc0d571b
...
@@ -28,6 +28,7 @@ from tkinter import messagebox
...
@@ -28,6 +28,7 @@ from tkinter import messagebox
import
tkinter
# used at _QueryDialog for tkinter._default_root
import
tkinter
# used at _QueryDialog for tkinter._default_root
class
SimpleDialog
:
class
SimpleDialog
:
def
__init__
(
self
,
master
,
def
__init__
(
self
,
master
,
...
@@ -119,7 +120,6 @@ class Dialog(Toplevel):
...
@@ -119,7 +120,6 @@ class Dialog(Toplevel):
'''
'''
def
__init__
(
self
,
parent
,
title
=
None
):
def
__init__
(
self
,
parent
,
title
=
None
):
'''Initialize a dialog.
'''Initialize a dialog.
Arguments:
Arguments:
...
@@ -324,9 +324,11 @@ class _QueryDialog(Dialog):
...
@@ -324,9 +324,11 @@ class _QueryDialog(Dialog):
class
_QueryInteger
(
_QueryDialog
):
class
_QueryInteger
(
_QueryDialog
):
errormessage
=
"Not an integer."
errormessage
=
"Not an integer."
def
getresult
(
self
):
def
getresult
(
self
):
return
self
.
getint
(
self
.
entry
.
get
())
return
self
.
getint
(
self
.
entry
.
get
())
def
askinteger
(
title
,
prompt
,
**
kw
):
def
askinteger
(
title
,
prompt
,
**
kw
):
'''get an integer from the user
'''get an integer from the user
...
@@ -341,11 +343,14 @@ def askinteger(title, prompt, **kw):
...
@@ -341,11 +343,14 @@ def askinteger(title, prompt, **kw):
d
=
_QueryInteger
(
title
,
prompt
,
**
kw
)
d
=
_QueryInteger
(
title
,
prompt
,
**
kw
)
return
d
.
result
return
d
.
result
class
_QueryFloat
(
_QueryDialog
):
class
_QueryFloat
(
_QueryDialog
):
errormessage
=
"Not a floating point value."
errormessage
=
"Not a floating point value."
def
getresult
(
self
):
def
getresult
(
self
):
return
self
.
getdouble
(
self
.
entry
.
get
())
return
self
.
getdouble
(
self
.
entry
.
get
())
def
askfloat
(
title
,
prompt
,
**
kw
):
def
askfloat
(
title
,
prompt
,
**
kw
):
'''get a float from the user
'''get a float from the user
...
@@ -360,6 +365,7 @@ def askfloat(title, prompt, **kw):
...
@@ -360,6 +365,7 @@ def askfloat(title, prompt, **kw):
d
=
_QueryFloat
(
title
,
prompt
,
**
kw
)
d
=
_QueryFloat
(
title
,
prompt
,
**
kw
)
return
d
.
result
return
d
.
result
class
_QueryString
(
_QueryDialog
):
class
_QueryString
(
_QueryDialog
):
def
__init__
(
self
,
*
args
,
**
kw
):
def
__init__
(
self
,
*
args
,
**
kw
):
if
"show"
in
kw
:
if
"show"
in
kw
:
...
@@ -378,6 +384,7 @@ class _QueryString(_QueryDialog):
...
@@ -378,6 +384,7 @@ class _QueryString(_QueryDialog):
def
getresult
(
self
):
def
getresult
(
self
):
return
self
.
entry
.
get
()
return
self
.
entry
.
get
()
def
askstring
(
title
,
prompt
,
**
kw
):
def
askstring
(
title
,
prompt
,
**
kw
):
'''get a string from the user
'''get a string from the user
...
@@ -393,7 +400,6 @@ def askstring(title, prompt, **kw):
...
@@ -393,7 +400,6 @@ def askstring(title, prompt, **kw):
return
d
.
result
return
d
.
result
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
def
test
():
def
test
():
...
...
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