Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirements: ovos-utils version #304

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading