Skip to content

Commit a489ea5

Browse files
committed
Refactor init for initialize backwards-compat.
1 parent 3291d20 commit a489ea5

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

ovos_workshop/skills/common_play.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def ...
5050
vocab for starting playback is needed.
5151
"""
5252

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

7170
def bind(self, bus):
7271
"""Overrides the normal bind method.

ovos_workshop/skills/common_query_skill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class CommonQuerySkill(OVOSSkill):
5757
"""
5858

5959
def __init__(self, name=None, bus=None, **kwargs):
60-
OVOSSkill.__init__(self, name, bus, **kwargs)
6160
noise_words_filepath = f"text/{self.lang}/noise_words.list"
6261
default_res = f"{dirname(dirname(__file__))}/res/text/{self.lang}/noise_words.list"
6362
noise_words_filename = resolve_resource_file(noise_words_filepath) or \
@@ -75,6 +74,7 @@ def __init__(self, name=None, bus=None, **kwargs):
7574
CQSMatchLevel.CATEGORY: 0.6,
7675
CQSMatchLevel.GENERAL: 0.5
7776
}
77+
OVOSSkill.__init__(self, name, bus, **kwargs)
7878

7979
@property
8080
def translated_noise_words(self):

ovos_workshop/skills/fallback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ class FallbackSkillV1(_MetaFB, metaclass=_MutableFallback):
100100
wrapper_map: List[Tuple[callable, callable]] = [] # [(handler, wrapper)]
101101

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

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

110110
@classmethod
111111
def make_intent_failure_handler(cls, bus: MessageBusClient):

0 commit comments

Comments
 (0)