Skip to content

Commit

Permalink
Remove old patch (#522)
Browse files Browse the repository at this point in the history
* Deprecate patched `add_event` method for latest ovos-workshop compat.

* Fix accidental changes

---------

Co-authored-by: Daniel McKnight <daniel@neon.ai>
  • Loading branch information
NeonDaniel and NeonDaniel authored May 8, 2024
1 parent de4b4c2 commit 2aaf80c
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions neon_utils/skills/neon_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
DEFAULT_SPEED_MODE = "thoughtful"
CACHE_TIME_OFFSET = 24*60*60 # seconds in 24 hours


@deprecated("deprecated without replacement, skill settings no longer shipped in skill folder", "2.0.0")
def save_settings(skill_dir, skill_settings):
"""Save skill settings to file."""
Expand Down Expand Up @@ -893,22 +894,3 @@ def init_dialog(self, root_directory: Optional[str] = None):
"""
log_deprecation("Use `load_dialog_files`", "2.0.0")
self.load_dialog_files(root_directory)

def add_event(self, name: str, handler: callable,
handler_info: Optional[str] = None, once: bool = False,
speak_errors: bool = True):
# TODO: Remove with ovos-workshop==0.0.13
try:
# Patching FakeBus compat. with MessageBusClient
if hasattr(self.bus, "ee"):
emitter = self.bus.ee
else:
emitter = self.bus.emitter
if handler_info == "mycroft.skill.handler" and \
emitter.listeners(name):
LOG.warning(f"Not re-registering intent handler {name}")
return
except Exception as e:
LOG.exception(e)
OVOSSkill.add_event(self, name, handler, handler_info, once,
speak_errors)

0 comments on commit 2aaf80c

Please sign in to comment.