Skip to content

Commit

Permalink
restor backwaeds compat method
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 21, 2023
1 parent 58b8f86 commit ebf2ebe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
25 changes: 19 additions & 6 deletions ovos_workshop/skills/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@
from threading import Event, RLock
from typing import List, Optional, Dict, Callable, Union

from ovos_bus_client import MessageBusClient
from ovos_bus_client.session import SessionManager
from json_database import JsonStorage
from lingua_franca.format import pronounce_number, join_list
from lingua_franca.parse import yes_or_no, extract_number
from ovos_backend_client.api import EmailApi, MetricsApi
from ovos_bus_client.message import Message, dig_for_message
from ovos_config.config import Configuration
from ovos_config.locations import get_xdg_config_save_path

from ovos_bus_client import MessageBusClient
from ovos_bus_client.message import Message, dig_for_message
from ovos_bus_client.session import SessionManager
from ovos_utils import camel_case_split
from ovos_utils import classproperty
from ovos_utils.dialog import get_dialog, MustacheDialogRenderer
from ovos_utils.enclosure.api import EnclosureAPI
from ovos_utils.events import EventContainer, EventSchedulerInterface
Expand All @@ -52,8 +54,6 @@
from ovos_utils.parse import match_one
from ovos_utils.process_utils import RuntimeRequirements
from ovos_utils.skills import get_non_properties
from ovos_utils import classproperty

from ovos_workshop.decorators.compat import backwards_compat
from ovos_workshop.decorators.killable import AbortEvent
from ovos_workshop.decorators.killable import killable_event, \
Expand All @@ -64,6 +64,18 @@
from ovos_workshop.settings import SkillSettingsManager


def is_classic_core():
try:
from mycroft.version import OVOS_VERSION_STR
return False
except:
try:
import mycroft
return True
except:
return False


# backwards compat alias
class SkillNetworkRequirements(RuntimeRequirements):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -457,7 +469,7 @@ def _secondary_langs(self) -> List[str]:
work in regular mycroft-core it was made private!
"""
return [lang.lower() for lang in self.config_core.get(
'secondary_langs', []) if lang != self._core_lang]
'secondary_langs', []) if lang != self._core_lang]

# property not present in mycroft-core
@property
Expand Down Expand Up @@ -1000,6 +1012,7 @@ def __get_response(self):
Returns:
str: user's response or None on a timeout
"""

# TODO: Support `message` signature like default?
def converse(utterances, lang=None):
converse.response = utterances[0] if utterances else None
Expand Down
12 changes: 0 additions & 12 deletions ovos_workshop/skills/mycroft_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@
from ovos_workshop.skills.base import BaseSkill


def is_classic_core():
try:
from mycroft.version import OVOS_VERSION_STR
return False
except:
try:
import mycroft
return True
except:
return False


class _SkillMetaclass(ABCMeta):
"""
This metaclass ensures we can load skills like regular python objects.
Expand Down

0 comments on commit ebf2ebe

Please sign in to comment.