Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "Show Downloads" open with the default file browser #49

Open
GoogleCodeExporter opened this issue Dec 7, 2015 · 3 comments
Open

Comments

@GoogleCodeExporter
Copy link

I find that opening the Downloads folder in a webbrowser (as the current code 
specifies) is kind of an odd way to do this. From my brief Googling I realize 
there isn't a perfectly elegant way to use the file browser, but there are a 
few ways that are not bad.

I've attached a diff for a quick way to implement the desired behavior. Since I 
only run a Linux environment I haven't tested OSX or Windows, but my 
web-sources tell me that this is the proper way to implement the code on those 
platforms. I apologize that I cannot cite those sources, but I patched this on 
my local machine months ago and am only now submitting my suggestion

Original issue reported on code.google.com by [email protected] on 15 Apr 2012 at 7:52

Attachments:

@GoogleCodeExporter
Copy link
Author

Think there's a slight bug in the patch in that is has 2 Mac options and no 
Windows :)

I suggest instead:

        if sys.platform == 'linux2':
          subprocess.Popen(['xdg-open', settings.save_dir])
        elif sys.platform == 'darwin':
          subprocess.Popen(['open', settings.save_dir])
        elif sys.platform == 'win32':
          os.startfile(settings.save_dir)
        else:
          webbrowser.open(settings.save_dir)

Not sure about 64-bit Windows's ID.

Original comment by [email protected] on 28 Jul 2012 at 10:51

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Well, would you look at that. OK, looks like you've got it.

The Python documentation (http://docs.python.org/library/sys.html#sys.platform) 
seems to suggest that the ID for windows is 'win32' regardless of the platform.

(Edit: damn wikisyntax)

Original comment by [email protected] on 8 Oct 2012 at 10:34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant