Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions plyer/platforms/linux/storagepath.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
'''

from plyer.facades import StoragePath
from os.path import expanduser, dirname, abspath
from os.path import expanduser, dirname, abspath, isdir, join
import os

# Default paths for each name
USER_DIRS = "/.config/user-dirs.dirs"
Expand Down Expand Up @@ -38,7 +39,9 @@ def _get_home_dir(self):
return expanduser('~')

def _get_external_storage_dir(self):
return "/media/" + self._get_home_dir().split("/")[-1]
for i in ["/media", "/run/media"]:
if isdir(i):
return join(i, os.getlogin())

def _get_root_dir(self):
return "/"
Expand Down