Skip to content

Commit

Permalink
refactor!:drop mycroft
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Oct 15, 2024
1 parent a096b41 commit d1a48f6
Show file tree
Hide file tree
Showing 27 changed files with 44 additions and 1,045 deletions.
44 changes: 0 additions & 44 deletions ovos_workshop/decorators/compat.py

This file was deleted.

2 changes: 1 addition & 1 deletion ovos_workshop/decorators/ocp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ovos_workshop.backwards_compat import MediaType, PlayerState, MediaState, MatchConfidence, \
from ovos_utils.ocp import MediaType, PlayerState, MediaState, MatchConfidence, \
PlaybackType, PlaybackMode, LoopState, TrackState


Expand Down
4 changes: 2 additions & 2 deletions ovos_workshop/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import yaml
from json_database import JsonStorageXDG

from ovos_workshop.skills.ovos import OVOSSkill
from ovos_backend_client.api import DeviceApi
from ovos_backend_client.pairing import is_paired, requires_backend
from ovos_backend_client.settings import RemoteSkillSettings, get_display_name
Expand All @@ -16,9 +17,8 @@

class SkillSettingsManager:
def __init__(self, skill):
from ovos_workshop.skills.base import BaseSkill
self.download_timer: Optional[Timer] = None
self.skill: BaseSkill = skill
self.skill: OVOSSkill = skill
self.api = DeviceApi()
self.remote_settings = \
RemoteSkillSettings(self.skill_id,
Expand Down
14 changes: 5 additions & 9 deletions ovos_workshop/skill_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,19 @@

from ovos_workshop.skills.active import ActiveSkill
from ovos_workshop.skills.auto_translatable import UniversalSkill, UniversalFallback
from ovos_workshop.skills.base import BaseSkill
from ovos_workshop.skills.common_play import OVOSCommonPlaybackSkill
from ovos_workshop.skills.common_query_skill import CommonQuerySkill
from ovos_workshop.skills.fallback import FallbackSkill
from ovos_workshop.skills.mycroft_skill import MycroftSkill
from ovos_workshop.skills.ovos import OVOSSkill, OVOSFallbackSkill
from ovos_workshop.skills.ovos import OVOSSkill

SKILL_BASE_CLASSES = [
BaseSkill, MycroftSkill, OVOSSkill, OVOSFallbackSkill,
OVOSCommonPlaybackSkill, OVOSFallbackSkill, CommonQuerySkill, ActiveSkill,
OVOSSkill, OVOSCommonPlaybackSkill, CommonQuerySkill, ActiveSkill,
FallbackSkill, UniversalSkill, UniversalFallback
]

SKILL_MAIN_MODULE = '__init__.py'



def remove_submodule_refs(module_name: str):
"""
Ensure submodules are reloaded by removing the refs from sys.modules.
Expand Down Expand Up @@ -85,13 +81,13 @@ def load_skill_module(path: str, skill_id: str) -> ModuleType:

def get_skill_class(skill_module: ModuleType) -> Optional[callable]:
"""
Find MycroftSkill based class in skill module.
Find OVOSSkill based class in skill module.
Arguments:
skill_module (module): module to search for Skill class
Returns:
(MycroftSkill): Found subclass of MycroftSkill or None.
(OVOSSkill): Found subclass of OVOSSkill or None.
"""
if not skill_module:
raise ValueError("Expected module and got None")
Expand Down Expand Up @@ -156,7 +152,7 @@ def __init__(self, bus: MessageBusClient,
self._loaded = None
self.load_attempted = False
self.last_loaded = 0
self.instance: Optional[BaseSkill] = None
self.instance: Optional[OVOSSkill] = None
self.active = True
self._watchdog = None
self.config = Configuration()
Expand Down
5 changes: 0 additions & 5 deletions ovos_workshop/skills/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
from ovos_workshop.decorators.layers import IntentLayers
from ovos_workshop.skills.ovos import OVOSSkill, OVOSFallbackSkill
from ovos_workshop.skills.idle_display_skill import IdleDisplaySkill
from ovos_workshop.skills.mycroft_skill import MycroftSkill

17 changes: 0 additions & 17 deletions ovos_workshop/skills/base.py

This file was deleted.

2 changes: 1 addition & 1 deletion ovos_workshop/skills/common_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# backwards compat imports, do not delete, skills import from here
from ovos_workshop.decorators.ocp import ocp_play, ocp_next, ocp_pause, ocp_resume, ocp_search, \
ocp_previous, ocp_featured_media
from ovos_workshop.backwards_compat import MediaType, MediaState, MatchConfidence, \
from ovos_utils.ocp import MediaType, MediaState, MatchConfidence, \
PlaybackType, PlaybackMode, PlayerState, LoopState, TrackState, Playlist, PluginStream, MediaEntry


Expand Down
16 changes: 0 additions & 16 deletions ovos_workshop/skills/common_query_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from ovos_utils.file_utils import resolve_resource_file
from ovos_utils.log import LOG, log_deprecation

from ovos_workshop.decorators.compat import backwards_compat
from ovos_workshop.skills.ovos import OVOSSkill


Expand Down Expand Up @@ -233,21 +232,6 @@ def __calc_confidence(self, match: str, phrase: str, level: CQSMatchLevel,

return confidence

def __handle_query_classic(self, message):
"""
does not perform self.speak, < 0.0.8 this is done by core itself
"""
if message.data["skill_id"] != self.skill_id:
# Not for this skill!
return
self.activate()
phrase = message.data["phrase"]
data = message.data.get("callback_data") or {}
# Invoke derived class to provide playback data
self.CQS_action(phrase, data)

@backwards_compat(classic_core=__handle_query_classic,
pre_008=__handle_query_classic)
def __handle_query_action(self, message: Message):
"""
If this skill's response was spoken to the user, this method is called.
Expand Down
4 changes: 0 additions & 4 deletions ovos_workshop/skills/decorators/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions ovos_workshop/skills/decorators/converse.py

This file was deleted.

4 changes: 0 additions & 4 deletions ovos_workshop/skills/decorators/fallback_handler.py

This file was deleted.

4 changes: 0 additions & 4 deletions ovos_workshop/skills/decorators/killable.py

This file was deleted.

4 changes: 0 additions & 4 deletions ovos_workshop/skills/decorators/layers.py

This file was deleted.

4 changes: 0 additions & 4 deletions ovos_workshop/skills/decorators/ocp.py

This file was deleted.

Loading

0 comments on commit d1a48f6

Please sign in to comment.