Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch backwards-compat method removed from ovos-utils 0.1 #534

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading