diff options
author | Laurie Clark-Michalek <bluepeppers@archlinux.us> | 2012-12-25 16:43:22 +0000 |
---|---|---|
committer | Laurie Clark-Michalek <bluepeppers@archlinux.us> | 2012-12-25 16:43:22 +0000 |
commit | db0dd9c630bce6ba460499e51a2a581fa2f4260b (patch) | |
tree | 70cccbe7c815ed5b454b690fa67a7a9da288041b | |
parent | 25d7e3baf1271a74bbd58ea9ab45a59b83e3bf83 (diff) |
Fixed problem for people without XDG_CONFIG_HOME
-rwxr-xr-x | archey3 | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -532,8 +532,13 @@ distro(), uname(n), uname(r), uptime(), wm(), de(), packages(), ram(),\ default config file to $XDG_CONFIG_HOME/archey3.cfg. """ - config_location = os.path.expandvars(os.path.expanduser( - file_location or "$XDG_CONFIG_HOME/archey3.cfg")) + if file_location is None and "XDG_CONFIG_HOME" not in os.environ: + config_location = os.path.expanduser("~/.archey3.cfg") + elif file_location is None: + config_location = os.path.expandvars("$XDG_CONFIG_HOME/archey3.cfg") + else: + config_location = \ + os.path.expandvars(os.path.expanduser(file_location)) loaded = super(ArcheyConfigParser, self).read(config_location) |