Skip to content

Commit

Permalink
Patch backwards-compat method removed from ovos-utils 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Sep 13, 2024
1 parent 71eca90 commit df7a08a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions neon_utils/skills/mycroft_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
from typing import Optional
from json_database import JsonStorage
from ovos_bus_client.message import Message
from ovos_utils.log import log_deprecation
from ovos_utils.log import log_deprecation, deprecated
from ovos_workshop.skills.mycroft_skill import MycroftSkill
from ovos_utils.skills.settings import get_local_settings
# from ovos_utils.skills.settings import get_local_settings

from neon_utils.signal_utils import wait_for_signal_clear, check_for_signal
from neon_utils.logger import LOG
Expand All @@ -47,6 +47,19 @@
from neon_utils.user_utils import get_user_prefs


@deprecated("deprecated without replacement, skill settings no longer shipped in skill folder", "0.1.0")
def get_local_settings(skill_dir, skill_name=None) -> dict:
"""Build a JsonStorage using the JSON string stored in settings.json."""
if skill_name:
log_deprecation("skill_name is an unused legacy argument", "0.1.0")
if skill_dir.endswith("/settings.json"):
settings_path = skill_dir
else:
settings_path = os.path.join(skill_dir, 'settings.json')
LOG.info(settings_path)
return JsonStorage(settings_path)


class PatchedMycroftSkill(MycroftSkill):
def __init__(self, name=None, bus=None, *args, **kwargs):
MycroftSkill.__init__(self, name, bus, *args, **kwargs)
Expand Down

0 comments on commit df7a08a

Please sign in to comment.