From 58d23f1f010e5d58b8d9296dae27988c939a53b1 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Tue, 22 Oct 2024 21:00:40 +0200 Subject: default config file and user override --- __main__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to '__main__.py') diff --git a/__main__.py b/__main__.py index bae42ce..8818205 100644 --- a/__main__.py +++ b/__main__.py @@ -3,6 +3,7 @@ import sys import yaml from pathlib import Path +from .modules.config import load_config from .modules.hassil.recognize import recognize from .modules.hassil.util import merge_dict from .modules.hassil.intents import Intents, TextSlotList @@ -11,18 +12,18 @@ from .modules.intents import * def main(): + config = load_config() input_dict = {"intents": {}} - yaml_path = Path(sys.argv[1]) + yaml_path = Path(config.intents_dir) yaml_file_paths = yaml_path.glob("*.yaml") processes = [] - bin_dir = "/usr/bin" - for file in os.listdir(bin_dir): + for file in os.listdir(config.applications_dir): if file == "[": continue - full_path = os.path.join(bin_dir, file) + full_path = os.path.join(config.applications_dir, file) if os.path.isfile(full_path) or os.path.islink(full_path): processes.append(file) -- cgit v1.2.3-70-g09d2