GenericDirCtrl.GetPaths(paths) doesn't exist?

I got a problem using GetPaths for my GenericDirCtrl, the doc says it exist a GetPaths to get all the path of each repository selected but it return nothing and doesn’t change my array/list, any idear to how to do it if it exist. The same happen with GetFilePaths, and no one on internet use it:


No error so it should be working

It’s difficult to read, at least for me (I don’t know about the interpreter): there is no need for power saving on the forum because most users will use at least a PC :merman:

I’ve “Pythonized” the GetPaths method so it returns the list of paths instead of trying to update the arg. The change will be in the next snapshot build.

Ok the problem is that ive also tried that and the array it return is always set to ‘none’ ive found an other solution to by pass it by updating a list when i’m selecting an element and put a button that get this self.list (when i say ‘i’ it’s actualy one of my formator that found it xD)

If that’s the case then you’re not using one of the snapshot builds that have been made since the change was implemented on the 16th. I just added these test cases to be sure:

    def test_dirctrlGetPath(self):
        d = wx.GenericDirCtrl(self.frame)
        d.ExpandPath(os.path.dirname(THIS_FILE))
        d.SelectPath(THIS_FILE)
        p = d.GetPath()
        assert isinstance(p, str)
        assert p == THIS_FILE

    def test_dirctrlGetPaths(self):
        d = wx.GenericDirCtrl(self.frame, style=wx.DIRCTRL_MULTIPLE)
        d.ExpandPath(os.path.dirname(THIS_FILE))
        d.SelectPaths([THIS_FILE])
        p = d.GetPaths()
        assert isinstance(p, list)
        assert p == [THIS_FILE]
1 Like

Nope, i didn’t know there was one ! Thanks i will probably upgrade to it.