From b704f0dfae099b7a91e9f866edc9786531963bc7 Mon Sep 17 00:00:00 2001 From: Mikhail Zakharov Date: Sun, 4 Feb 2024 19:07:00 -0500 Subject: [PATCH] fix config path --- birdnetapp/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/birdnetapp/app.py b/birdnetapp/app.py index 44fe32b..8dc37d4 100644 --- a/birdnetapp/app.py +++ b/birdnetapp/app.py @@ -22,7 +22,8 @@ from .clean import cleanup from dataclasses import dataclass import yaml - +import os +dir_path = os.path.dirname(os.path.realpath(__file__)) _LOGGER = logging.getLogger(__name__) @@ -52,7 +53,7 @@ class Config: rate: int @classmethod - def load(cls, path: str = os.path.abspath("config.yaml")) -> "Config": + def load(cls, path: str = os.path.join(dir_path, "..", "config.yaml")) -> "Config": with open(path, "r") as f: config_dict = yaml.safe_load(f) return cls(**config_dict)