Skip to content

Commit

Permalink
Refactor init for initialize backwards-compat.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jul 19, 2023
1 parent 3291d20 commit a489ea5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions ovos_workshop/skills/common_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def ...
vocab for starting playback is needed.
"""

def __init__(self, name=None, bus=None, **kwargs):
OVOSSkill.__init__(self, name, bus, **kwargs)
# NOTE: derived skills will likely want to override this list
def __init__(self, name=None, bus=None, **kwargs): # NOTE: derived skills will likely want to override this list
self.supported_media = [MediaType.GENERIC,
MediaType.AUDIO]
self._search_handlers = [] # added via decorators
Expand All @@ -67,6 +65,7 @@ def __init__(self, name=None, bus=None, **kwargs):
self._playing = Event()
# TODO replace with new default
self.skill_icon = "https://github.com/OpenVoiceOS/ovos-ocp-audio-plugin/raw/master/ovos_plugin_common_play/ocp/res/ui/images/ocp.png"
OVOSSkill.__init__(self, name, bus, **kwargs)

def bind(self, bus):
"""Overrides the normal bind method.
Expand Down
2 changes: 1 addition & 1 deletion ovos_workshop/skills/common_query_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class CommonQuerySkill(OVOSSkill):
"""

def __init__(self, name=None, bus=None, **kwargs):
OVOSSkill.__init__(self, name, bus, **kwargs)
noise_words_filepath = f"text/{self.lang}/noise_words.list"
default_res = f"{dirname(dirname(__file__))}/res/text/{self.lang}/noise_words.list"
noise_words_filename = resolve_resource_file(noise_words_filepath) or \
Expand All @@ -75,6 +74,7 @@ def __init__(self, name=None, bus=None, **kwargs):
CQSMatchLevel.CATEGORY: 0.6,
CQSMatchLevel.GENERAL: 0.5
}
OVOSSkill.__init__(self, name, bus, **kwargs)

@property
def translated_noise_words(self):
Expand Down
2 changes: 1 addition & 1 deletion ovos_workshop/skills/fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ class FallbackSkillV1(_MetaFB, metaclass=_MutableFallback):
wrapper_map: List[Tuple[callable, callable]] = [] # [(handler, wrapper)]

def __init__(self, name=None, bus=None, use_settings=True, **kwargs):
super().__init__(name, bus, use_settings, **kwargs)
# list of fallback handlers registered by this instance
self.instance_fallback_handlers = []

# "skill_id": priority (int) overrides
self.fallback_config = self.config_core["skills"].get("fallbacks", {})
super().__init__(name, bus, use_settings, **kwargs)

@classmethod
def make_intent_failure_handler(cls, bus: MessageBusClient):
Expand Down

0 comments on commit a489ea5

Please sign in to comment.