Skip to content

Commit

Permalink
requirements: ovos-utils version (#304)
Browse files Browse the repository at this point in the history
silence log spam for deprecation warnings
  • Loading branch information
JarbasAl authored Dec 6, 2024
1 parent e0b9639 commit fe54ba8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion ovos_workshop/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ovos_workshop/resource_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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


Expand All @@ -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:
Expand Down
10 changes: 7 additions & 3 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,16 +1553,20 @@ 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
self.bus.emit(message.forward(msg_type, skill_data))
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."""
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit fe54ba8

Please sign in to comment.