Commit 9b59aa3e authored by Laurent Bachelier's avatar Laurent Bachelier

Use XDG_DATA_DIRS environment variable if possible

parent 113ee25f
......@@ -64,9 +64,16 @@ class GroupsConfig(IObject, dict):
class Storage(object):
DIRNAME = '.ass2m'
DATA_PATHS = [os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'data')),
os.path.join(sys.prefix, 'share', 'ass2m'),
os.path.join(sys.prefix, 'local', 'share', 'ass2m')]
DATA_PATHS = [os.path.realpath(os.path.join(
os.path.pardir, 'data'))] \
+ [os.path.join(d, 'ass2m')
for d
in os.getenv('XDG_DATA_DIRS',
':'.join([os.path.join(sys.prefix, 'share'),
os.path.join(sys.prefix, 'local', 'share')])
def __init__(self, path):
self.path = path
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment