Commit e134dc07 authored by Lysander Trischler's avatar Lysander Trischler
Browse files

Do variable expanding on paths correctly

Now not only ``$HOME`` is substituted correctly but also all other env vars
like ``$PWD`` and others.
parent cf2883c2
......@@ -49,7 +49,7 @@ class Config(ConfigParser.ConfigParser):
return default
def path(*path):
return os.path.join(*[os.path.expanduser(segment.replace("$HOME", "~")) for segment in path])
return os.path.join(*[os.path.expanduser(os.path.expandvars(segment)) for segment in path])
DATA_DIR = path(os.getenv("XDG_DATA_HOME", "~/.local/share"), "yfav")
CONFIG_FILE = path(os.getenv("XDG_CONFIG_HOME", "~/.config"), "yfav") # never used
Supports Markdown
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