Skip to content
Open
Changes from all commits
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
20 changes: 10 additions & 10 deletions appdirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,20 @@ def site_data_dir(appname=None, appauthor=None, version=None, multipath=False):
if appname:
path = os.path.join(path, appname)
else:
# XDG default for $XDG_DATA_DIRS
# only first, if multipath is False
path = os.getenv('XDG_DATA_DIRS',
os.pathsep.join(['/usr/local/share', '/usr/share']))
pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep)]
# XDG default: $XDG_DATA_DIRS for searching through multiple directories,
# '/usr/local/share' for single application directory
# (for distribution independent files, also '/usr/share' could be used)
if multipath:
path = os.getenv('XDG_DATA_DIRS',
os.pathsep.join(['/usr/local/share', '/usr/share']))
pathlist = [os.path.expanduser(x.rstrip(os.sep)) for x in path.split(os.pathsep)]
else:
pathlist = ['/usr/local/share']
if appname:
if version:
appname = os.path.join(appname, version)
pathlist = [os.sep.join([x, appname]) for x in pathlist]

if multipath:
path = os.pathsep.join(pathlist)
else:
path = pathlist[0]
path = os.pathsep.join(pathlist)
return path

if appname and version:
Expand Down