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

fix circular import #89

Merged
merged 1 commit into from
Dec 27, 2023
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
11 changes: 10 additions & 1 deletion ovos_config/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

import ovos_config.locations as _oloc
from ovos_utils.json_helper import load_commented_json, merge_dict
from ovos_utils.log import LOG


def get_ovos_config():
Expand Down Expand Up @@ -121,6 +120,8 @@ def get_ovos_default_config_paths():
eg. ["/etc/OpenVoiceOS/ovos.conf", "/home/user/.config/OpenVoiceOS/ovos.conf"]

"""
from ovos_utils.log import LOG

paths = []
if isfile("/etc/OpenVoiceOS/ovos.conf"):
paths.append("/etc/OpenVoiceOS/ovos.conf")
Expand All @@ -140,6 +141,8 @@ def get_ovos_default_config_paths():


def is_using_xdg():
from ovos_utils.log import LOG

""" BACKWARDS COMPAT: logs warning and always returns True"""
LOG.warning("is_using_xdg has been deprecated! XDG specs are always honoured, this method will be removed in a future release")
return True
Expand All @@ -163,6 +166,8 @@ def set_xdg_base(folder_name):

NOTE: this value will be set globally, per core overrides in ovos.conf take precedence
"""
from ovos_utils.log import LOG

LOG.info(f"XDG base folder set to: '{folder_name}'")
save_ovos_config({"base_folder": folder_name})

Expand All @@ -175,6 +180,8 @@ def set_config_filename(file_name, core_folder=None):

NOTE: this value will be set globally, per core overrides in ovos.conf take precedence
"""
from ovos_utils.log import LOG

if core_folder:
set_xdg_base(core_folder)
LOG.info(f"config filename set to: '{file_name}'")
Expand All @@ -198,6 +205,8 @@ def set_default_config(file_path=None):

NOTE: this value will be set globally, per core overrides in ovos.conf take precedence
"""
from ovos_utils.log import LOG

file_path = file_path or _oloc.find_default_config()
LOG.info(f"default config file changed to: {file_path}")
save_ovos_config({"default_config_path": file_path})
Loading