bpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822)

This commit is contained in:
Serhiy Storchaka 2018-10-12 19:01:00 +03:00 committed by GitHub
parent 2d6097d027
commit dc0d571b64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 565 additions and 9 deletions

View file

@ -78,32 +78,39 @@ def _show(title=None, message=None, _icon=None, _type=None, **options):
# In others we get a Tcl_Obj.
return str(res)
def showinfo(title=None, message=None, **options):
"Show an info message"
return _show(title, message, INFO, OK, **options)
def showwarning(title=None, message=None, **options):
"Show a warning message"
return _show(title, message, WARNING, OK, **options)
def showerror(title=None, message=None, **options):
"Show an error message"
return _show(title, message, ERROR, OK, **options)
def askquestion(title=None, message=None, **options):
"Ask a question"
return _show(title, message, QUESTION, YESNO, **options)
def askokcancel(title=None, message=None, **options):
"Ask if operation should proceed; return true if the answer is ok"
s = _show(title, message, QUESTION, OKCANCEL, **options)
return s == OK
def askyesno(title=None, message=None, **options):
"Ask a question; return true if the answer is yes"
s = _show(title, message, QUESTION, YESNO, **options)
return s == YES
def askyesnocancel(title=None, message=None, **options):
"Ask a question; return true if the answer is yes, None if cancelled."
s = _show(title, message, QUESTION, YESNOCANCEL, **options)
@ -113,6 +120,7 @@ def askyesnocancel(title=None, message=None, **options):
return None
return s == YES
def askretrycancel(title=None, message=None, **options):
"Ask if operation should be retried; return true if the answer is yes"
s = _show(title, message, WARNING, RETRYCANCEL, **options)