mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
bpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822)
This commit is contained in:
parent
2d6097d027
commit
dc0d571b64
8 changed files with 565 additions and 9 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue