diff --git a/scripts/birdnet_analysis.py b/scripts/birdnet_analysis.py index e34aaf1..ea2a5ce 100644 --- a/scripts/birdnet_analysis.py +++ b/scripts/birdnet_analysis.py @@ -12,7 +12,7 @@ import inotify.adapters from inotify.constants import IN_CLOSE_WRITE from server import load_global_model, run_analysis -from utils.helpers import get_settings, ParseFileName, get_wav_files, write_settings, ANALYZING_NOW +from utils.helpers import get_settings, ParseFileName, get_wav_files, ANALYZING_NOW from utils.reporting import extract_detection, summary, write_to_file, write_to_db, apprise, bird_weather, heartbeat, \ update_json_file @@ -28,7 +28,6 @@ def sig_handler(sig_num, curr_stack_frame): def main(): - write_settings() load_global_model() conf = get_settings() i = inotify.adapters.Inotify() diff --git a/scripts/utils/helpers.py b/scripts/utils/helpers.py index 210e367..0902c17 100644 --- a/scripts/utils/helpers.py +++ b/scripts/utils/helpers.py @@ -12,7 +12,6 @@ from tzlocal import get_localzone _settings = None DB_PATH = os.path.expanduser('~/BirdNET-Pi/scripts/birds.db') -THISRUN = os.path.expanduser('~/BirdNET-Pi/scripts/thisrun.txt') ANALYZING_NOW = os.path.expanduser('~/BirdSongs/StreamData/analyzing_now.txt') @@ -43,14 +42,6 @@ def get_settings(settings_path='/etc/birdnet/birdnet.conf', force_reload=False): return settings -def write_settings(file_name=THISRUN): - settings = _load_settings() - with open(file_name, 'w') as configfile: - for key in settings.keys(): - configfile.write(f'{key}={settings.get(key, raw=True)}\n') - os.chmod(file_name, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP) - - class Detection: def __init__(self, start_time, stop_time, species, confidence): self.start = float(start_time)