diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-10-12 19:01:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-12 19:01:00 +0300 |
commit | dc0d571b6401527f236b0513f29847e2b9b8a188 (patch) | |
tree | f6c9193dc5a7352e511ed1e5ca5e6faab1afc9b8 /Lib/tkinter/filedialog.py | |
parent | 2d6097d027e0dd3debbabc702aa9c98d94ba32a3 (diff) | |
download | cpython-git-dc0d571b6401527f236b0513f29847e2b9b8a188.tar.gz |
bpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822)
Diffstat (limited to 'Lib/tkinter/filedialog.py')
-rw-r--r-- | Lib/tkinter/filedialog.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py index a71afb25b9..d9d3436145 100644 --- a/Lib/tkinter/filedialog.py +++ b/Lib/tkinter/filedialog.py @@ -264,7 +264,6 @@ class SaveFileDialog(FileDialog): self.quit(file) - # For the following classes and modules: # # options (all have default values): @@ -341,6 +340,7 @@ class Open(_Dialog): 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 @@ class Directory(commondialog.Dialog): # # 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() |