diff options
author | Micah Lee <micah@micahflee.com> | 2018-11-26 18:03:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-26 18:03:52 -0800 |
commit | 6bfe9d4476b894e7d0dbb54f4bb689637ead0ad0 (patch) | |
tree | beb135d1eca802a9111d4176b6a7d156987379f2 /onionshare | |
parent | 4a765e0768ca42109a7748f5686f4fd4e86259f2 (diff) | |
parent | 86b537a4a6376a4280f30912ab9b2e313083c058 (diff) | |
download | onionshare-6bfe9d4476b894e7d0dbb54f4bb689637ead0ad0.tar.gz onionshare-6bfe9d4476b894e7d0dbb54f4bb689637ead0ad0.zip |
Merge pull request #763 from mig5/open_folder_uploads_macos_windows
Open folder containing uploads with the file selected, in macOS and Windows
Diffstat (limited to 'onionshare')
-rw-r--r-- | onionshare/settings.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/onionshare/settings.py b/onionshare/settings.py index ed827cbd..42f7259c 100644 --- a/onionshare/settings.py +++ b/onionshare/settings.py @@ -138,9 +138,13 @@ class Settings(object): """ Returns the path of the default Downloads directory for receive mode. """ - # TODO: Test in Windows, though it looks like it should work - # https://docs.python.org/3/library/os.path.html#os.path.expanduser - return os.path.expanduser('~/OnionShare') + # On Windows, os.path.expanduser() needs to use backslash, or else it + # retains the forward slash, which breaks opening the folder in explorer. + p = platform.system() + if p == 'Windows': + return os.path.expanduser('~\OnionShare') + else: + return os.path.expanduser('~/OnionShare') def load(self): """ |