From 55998c7c348d08b78064c9d57200b0bbc5aeab11 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Fri, 3 Jun 2022 10:58:21 -0400 Subject: [PATCH] Added more specifications for * for Mac file_type testing --- PySimpleGUI.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index f6dd46a3..f6ebe9ab 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -version = __version__ = "4.60.0.22 Unreleased" +version = __version__ = "4.60.0.23 Unreleased" _change_log = """ Changelog since 4.60.0 released to PyPI on 8-May-2022 @@ -56,6 +56,8 @@ _change_log = """ Added cols_justification for Table element - list or tuple of strings that indicates how each column should be justified 4.60.0.22 Better error handling for table element's new justification list. If a bad value is found, will use the default value + 4.60.0.23 + Additional mac filetype testing.... added more combinations that specify """ __version__ = version.split()[0] # For PEP 396 and PEP 345 @@ -4856,7 +4858,7 @@ class Button(Element): elif self.BType == BUTTON_TYPE_BROWSE_FILE: if running_mac(): # Workaround for the "*.*" issue on Mac - is_all = [(x, y) for (x, y) in filetypes if y == "*" or y == "*.*" or y == "*.* *"] + is_all = [(x, y) for (x, y) in filetypes if y in ("*", "*.*", "*.* *", "*.", '.*')] if not len(set(filetypes)) > 1 and (len(is_all) != 0 or filetypes == FILE_TYPES_ALL_FILES): file_name = tk.filedialog.askopenfilename(initialdir=self.InitialFolder) else: @@ -4881,7 +4883,7 @@ class Button(Element): elif self.BType == BUTTON_TYPE_BROWSE_FILES: if running_mac(): # Workaround for the "*.*" issue on Mac - is_all = [(x, y) for (x, y) in filetypes if y == "*" or y == "*.*" or y == "*.* *"] + is_all = [(x, y) for (x, y) in filetypes if y in ("*", "*.*", "*.* *", "*.", '.*')] if not len(set(filetypes)) > 1 and (len(is_all) != 0 or filetypes == FILE_TYPES_ALL_FILES): file_name = tk.filedialog.askopenfilenames(initialdir=self.InitialFolder) else: @@ -4903,7 +4905,7 @@ class Button(Element): # show the 'get file' dialog box if running_mac(): # Workaround for the "*.*" issue on Mac - is_all = [(x, y) for (x, y) in filetypes if y == "*" or y == "*.*" or y == "*.* *"] + is_all = [(x, y) for (x, y) in filetypes if y in ("*", "*.*", "*.* *", "*.", '.*')] if not len(set(filetypes)) > 1 and (len(is_all) != 0 or filetypes == FILE_TYPES_ALL_FILES): file_name = tk.filedialog.asksaveasfilename(defaultextension=self.DefaultExtension, initialdir=self.InitialFolder) else: @@ -25071,4 +25073,4 @@ if __name__ == '__main__': exit(0) main() exit(0) -def get_signature(): return b'\x1e\x94j\x0b\xe5Mi\xe0\x00$\x12s\x93\x88\xf7\x95K\xec\xa3\xcd\xaa\x84\x89M\xe9\xdbiQ2\x018_\xf34W\xfd\x0c\x98q\x12Q\x96\xc2\xa8\x12t\xd8\xc2\xf8\xf6Y\xc3\xd6\x7fYJ\x0eA\xd0\xf9\xb2pk\xa4\xce\x86\xa3A\xe3\xf4\xb4H\x0f(\xad\xfeD\xd0\x97p\x05\x06\xb0Wo\xbd\xc0,K\x01\xa5Z\x1e\xb3\xf5\x07V?D3b\xea\xce\xce\xdb\xc7\x13\x0e\xa0O[l\x02\xe0\xe5`>sZ\xd7\xcd\x9b\x91y\xbc\xb7\xb3\xf3'\x8e\x1a\xca\xd1+\xa2\xc0\x07]#\x92\xcc\xcc\xd6\x01#,\xdf\x1c\xb1\x89\x05\xc5\xadB)\x80\xfe\x86y\xd29\xab\x7f{\x83%%\x93c\xf8\x97T\xca\xfc\x9a}z\xaeqf\xf7l\x83\xa4" \ No newline at end of file