Mercurial > silorider
changeset 8:da8376f8d13a
Add default configuration file from XDG config home.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 29 Jul 2018 20:01:12 -0700 |
parents | 32c80c295769 |
children | 8830c7d59d7e |
files | silorider/main.py |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/silorider/main.py Sun Jul 29 19:49:11 2018 -0700 +++ b/silorider/main.py Sun Jul 29 20:01:12 2018 -0700 @@ -1,3 +1,4 @@ +import os import os.path import logging import argparse @@ -143,8 +144,13 @@ return logger.debug("Loading configuration.") + xdg_config_home = os.getenv('XDG_CONFIG_HOME', + os.path.expanduser('~/.config')) config = configparser.ConfigParser(interpolation=None) - config_paths = [os.path.join(os.path.dirname(__file__), 'default.cfg')] + config_paths = [ + os.path.join(os.path.dirname(__file__), 'default.cfg'), + os.path.join(xdg_config_home, 'silorider/silorider.cfg') + ] if args.config: config_paths.append(args.config) config.read(config_paths)