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

@ -264,7 +264,6 @@ def ok_command(self):
self.quit(file)
# For the following classes and modules:
#
# options (all have default values):
@ -341,6 +340,7 @@ def _fixresult(self, widget, result):
return self._fixresult(widget, widget.tk.splitlist(result))
return _Dialog._fixresult(self, widget, result)
class SaveAs(_Dialog):
"Ask for a filename to save as"
@ -369,16 +369,19 @@ def _fixresult(self, widget, result):
#
# convenience stuff
def askopenfilename(**options):
"Ask for a filename to open"
return Open(**options).show()
def asksaveasfilename(**options):
"Ask for a filename to save as"
return SaveAs(**options).show()
def askopenfilenames(**options):
"""Ask for multiple filenames to open
@ -390,6 +393,7 @@ def askopenfilenames(**options):
# FIXME: are the following perhaps a bit too convenient?
def askopenfile(mode = "r", **options):
"Ask for a filename to open, and returned the opened file"
@ -398,6 +402,7 @@ def askopenfile(mode = "r", **options):
return open(filename, mode)
return None
def askopenfiles(mode = "r", **options):
"""Ask for multiple filenames and return the open file
objects
@ -423,12 +428,12 @@ def asksaveasfile(mode = "w", **options):
return open(filename, mode)
return None
def askdirectory (**options):
"Ask for a directory, and return the file name"
return Directory(**options).show()
# --------------------------------------------------------------------
# test stuff
@ -475,5 +480,6 @@ def test():
saveasfilename=asksaveasfilename()
print("saveas", saveasfilename.encode(enc))
if __name__ == '__main__':
test()