diff --git a/gooey/gui/components/widgets/core/chooser.py b/gooey/gui/components/widgets/core/chooser.py index 03ba649c..2128c38b 100644 --- a/gooey/gui/components/widgets/core/chooser.py +++ b/gooey/gui/components/widgets/core/chooser.py @@ -136,17 +136,7 @@ def getDialog(self): defaultPath=options.get('default_path', os.getcwd()), agwStyle=MDD.DD_MULTIPLE | MDD.DD_DIR_MUST_EXIST) def getResult(self, dialog): - paths = dialog.GetPaths() - # Remove volume labels from Windows paths - if 'nt' == os.name: - for i, path in enumerate(paths): - if path: - parts = path.split(os.sep) - vol = parts[0] - drives = re.match(r'.*\((?P\w:)\)', vol) - paths[i] = os.sep.join([drives.group('drive')] + parts[1:]) - - return os.pathsep.join(paths) + return os.pathsep.join(dialog.GetPaths()) class DateChooser(Chooser): diff --git a/gooey/tests/test_chooser_results.py b/gooey/tests/test_chooser_results.py deleted file mode 100644 index 39e0094c..00000000 --- a/gooey/tests/test_chooser_results.py +++ /dev/null @@ -1,37 +0,0 @@ -import argparse -import os -import unittest - -from gooey.gui.components.widgets.core import chooser -from gooey.tests import * - - -class MockWxMDD: - def GetPaths(self): - pass - -class TestChooserResults(unittest.TestCase): - - def test_multiDirChooserGetResult(self): - expected_outputs = [ - (None, "", [""]), - - # Windows - ('nt', "C:", ["OS and System (C:)"]), - ('nt', "D:\\A Folder\\Yep Another One", - ["Other Stuff (D:)\\A Folder\\Yep Another One"]), - ('nt', "A:\\Wow Remember Floppy Drives;E:\\Righto Then", - ["Flipflop (A:)\\Wow Remember Floppy Drives", - "Elephants Only (E:)\\Righto Then"]) - ] - - for osname, expected, pathsoutput in expected_outputs: - if not osname or osname == os.name: - chooser.MDD.MultiDirDialog = MockWxMDD - chooser.MDD.MultiDirDialog.GetPaths = lambda self : pathsoutput - result = chooser.MultiDirChooser.getResult(None, MockWxMDD()) - print(result) - self.assertEqual(result, expected) - -if __name__ == '__main__': - unittest.main() diff --git a/requirements.txt b/requirements.txt index e138af4f..f73a815a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -wxpython>=4.1.0 +wxpython>=4.2.1 Pillow>=4.3.0 psutil>=5.4.2 colored>=1.3.93 diff --git a/setup.py b/setup.py index e2d82e68..7f4ff2f1 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ 'pygtrie>=2.3.3', 're-wx>=0.0.9', 'typing-extensions==3.10.0.2', - 'wxpython>=4.1.0', + 'wxpython>=4.2.1', "dataclasses>=0.8;python_version<'3.7'", ]