RLBot / RLBotGUI

33 stars 25 forks source link

Fix opening a file explorer, cross-platform #182

Closed VirxEC closed 2 years ago

VirxEC commented 2 years ago

Please pull #181 first, so the version update number goes in order

This should fix launching a file explorer in several different OSs.

Check out the package's readme for a list. It only needs to be listed to work. https://pypi.org/project/show-in-file-manager/

tarehart commented 2 years ago

I'm a bit nervous about this show-in-file-manager package, seems like very few people use it. That makes us more vulnerable to sloppy breaking changes / not getting fixes in a timely manner. Is there anything more popular we could use? I don't see anything from a quick search, but curious if you saw any alternatives.

VirxEC commented 2 years ago

It's extremely versatile and also open source, how about we (or just I) audit the latest version and pin that?

VirxEC commented 2 years ago

There's also this which I could explore from Stack Overflow:

def open_file(path):
    if platform.system() == "Windows":
        os.startfile(path)
    elif platform.system() == "Darwin":
        subprocess.Popen(["open", path])
    else:
        subprocess.Popen(["xdg-open", path])
VirxEC commented 2 years ago

Test on Windows and it works, I still need to test on Linux though

VirxEC commented 2 years ago

yep, it works!