diff options
-rw-r--r-- | common.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -48,10 +48,12 @@ def load_config(path=None, groupnames=None): for p in [Path(), Path(xdg_config_home).joinpath('webmap'), PosixPath('/etc').joinpath('webmap')]: - p = p.joinpath('config.yml') - if p.exists(): - path = str(p) + p = str(p.joinpath('config.yml')) + if os.path.exists(p): + path = p break + if path is None: + raise Exception('Could not find configuration file') with open(path, 'r') as fp: config = yaml.safe_load(fp) layers = config.get('layers', {}) |