diff --git a/ovos_workshop/app.py b/ovos_workshop/app.py index 6f0c811..65536e8 100644 --- a/ovos_workshop/app.py +++ b/ovos_workshop/app.py @@ -3,7 +3,6 @@ from ovos_config.locations import get_xdg_config_save_path from ovos_bus_client.util import get_mycroft_bus from ovos_utils.lang import standardize_lang_tag -from ovos_utils.log import log_deprecation from ovos_bus_client.apis.gui import GUIInterface from ovos_bus_client.client.client import MessageBusClient from ovos_workshop.resource_files import locate_lang_directories diff --git a/ovos_workshop/resource_files.py b/ovos_workshop/resource_files.py index bce9bcc..2263105 100644 --- a/ovos_workshop/resource_files.py +++ b/ovos_workshop/resource_files.py @@ -25,7 +25,7 @@ from langcodes import tag_distance from ovos_config.locations import get_xdg_data_save_path from ovos_utils import flatten_list -from ovos_utils.bracket_expansion import expand_options +from ovos_utils.bracket_expansion import expand_template from ovos_utils.dialog import MustacheDialogRenderer, load_dialogs from ovos_utils.log import LOG @@ -430,7 +430,7 @@ def load(self) -> List[List[str]]: vocabulary = [] if self.file_path is not None: for line in self._read(): - vocabulary.append(expand_options(line.lower())) + vocabulary.append(expand_template(line.lower())) return vocabulary @@ -453,7 +453,7 @@ def load(self, entities: bool = True) -> List[str]: if self.file_path is not None: for line in self._read(): line = line.replace("{{", "{").replace("}}", "}") - intents.extend(flatten_list(expand_options(line.lower()))) + intents.extend(flatten_list(expand_template(line.lower()))) if not entities: intents = [re.sub(r'{.*?}\s?', '', intent).strip() for intent in intents] elif self.data: diff --git a/ovos_workshop/skills/ovos.py b/ovos_workshop/skills/ovos.py index 3e89797..2de9df5 100644 --- a/ovos_workshop/skills/ovos.py +++ b/ovos_workshop/skills/ovos.py @@ -1553,9 +1553,6 @@ def _on_event_end(self, message: Message, handler_info: str, Store settings (if changed) and indicate that the skill handler has completed. """ - if self.settings != self._initial_settings: - self.settings.store() - self._initial_settings = copy(self.settings) if handler_info: msg_type = handler_info + '.complete' message.context["skill_id"] = self.skill_id @@ -1563,6 +1560,13 @@ def _on_event_end(self, message: Message, handler_info: str, if is_intent: self.bus.emit(message.forward("ovos.utterance.handled", skill_data)) + try: + if self.settings != self._initial_settings: + self.settings.store() + self._initial_settings = copy(self.settings) + except Exception as e: + LOG.error(f"Failed to update settings.json : {e}") + def _on_event_error(self, error: str, message: Message, handler_info: str, skill_data: dict, speak_errors: bool): """Speak and log the error.""" diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 042c82e..c061612 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,4 +1,4 @@ -ovos-utils>= 0.2.1,<1.0.0 +ovos-utils>= 0.6.0,<1.0.0 ovos_bus_client>=0.0.8,<2.0.0 ovos-config>=0.0.12,<2.0.0 ovos-solver-yes-no-plugin>=0.0.1,<1.0.0