summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/simpledialog.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-10-12 16:01:00 (GMT)
committerGitHub <noreply@github.com>2018-10-12 16:01:00 (GMT)
commitdc0d571b6401527f236b0513f29847e2b9b8a188 (patch)
treef6c9193dc5a7352e511ed1e5ca5e6faab1afc9b8 /Lib/tkinter/simpledialog.py
parent2d6097d027e0dd3debbabc702aa9c98d94ba32a3 (diff)
downloadcpython-dc0d571b6401527f236b0513f29847e2b9b8a188.zip
cpython-dc0d571b6401527f236b0513f29847e2b9b8a188.tar.gz
cpython-dc0d571b6401527f236b0513f29847e2b9b8a188.tar.bz2
bpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822)
Diffstat (limited to 'Lib/tkinter/simpledialog.py')
-rw-r--r--Lib/tkinter/simpledialog.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/tkinter/simpledialog.py b/Lib/tkinter/simpledialog.py
index a95f551..8524417 100644
--- a/Lib/tkinter/simpledialog.py
+++ b/Lib/tkinter/simpledialog.py
@@ -28,6 +28,7 @@ from tkinter import messagebox
import tkinter # used at _QueryDialog for tkinter._default_root
+
class SimpleDialog:
def __init__(self, master,
@@ -119,7 +120,6 @@ class Dialog(Toplevel):
'''
def __init__(self, parent, title = None):
-
'''Initialize a dialog.
Arguments:
@@ -324,9 +324,11 @@ class _QueryDialog(Dialog):
class _QueryInteger(_QueryDialog):
errormessage = "Not an integer."
+
def getresult(self):
return self.getint(self.entry.get())
+
def askinteger(title, prompt, **kw):
'''get an integer from the user
@@ -341,11 +343,14 @@ def askinteger(title, prompt, **kw):
d = _QueryInteger(title, prompt, **kw)
return d.result
+
class _QueryFloat(_QueryDialog):
errormessage = "Not a floating point value."
+
def getresult(self):
return self.getdouble(self.entry.get())
+
def askfloat(title, prompt, **kw):
'''get a float from the user
@@ -360,6 +365,7 @@ def askfloat(title, prompt, **kw):
d = _QueryFloat(title, prompt, **kw)
return d.result
+
class _QueryString(_QueryDialog):
def __init__(self, *args, **kw):
if "show" in kw:
@@ -378,6 +384,7 @@ class _QueryString(_QueryDialog):
def getresult(self):
return self.entry.get()
+
def askstring(title, prompt, **kw):
'''get a string from the user
@@ -393,7 +400,6 @@ def askstring(title, prompt, **kw):
return d.result
-
if __name__ == '__main__':
def test():