From: Urban Wallasch Date: Thu, 20 May 2021 18:21:40 +0000 (+0200) Subject: * Fixed config path heuristic once again. X-Git-Tag: v0.3~16 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=739d20eceb05dab995206315fe49d50d019d7613;p=ffpreview.git * Fixed config path heuristic once again. --- diff --git a/ffpreview.py b/ffpreview.py index 1b51cb0..74d7c0b 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -227,13 +227,13 @@ class ffConfig: cfg['conffile'] = args.config else: # try to locate a user config file - home = os.environ.get('HOME') + if os.environ.get('HOME'): + home_cfg = os.path.join(os.environ.get('HOME'), '.config') cfg['conffile'] = os.path.join( - os.path.dirname(os.path.realpath(__file__)) or os.environ.get('XDG_CONFIG_HOME') or - (os.path.join(home, '.config') if home else None) or os.environ.get('APPDATA') or - sys.path[0], + home_cfg or + os.path.dirname(os.path.realpath(__file__)), cfg['conffile'] ) fconf = ConfigParser(allow_no_value=True, defaults=cfg)