Skip to content

Commit

Permalink
fix circular import (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
emphasize authored Dec 27, 2023
1 parent 4e520d6 commit a835b22
Showing 1 changed file with 10 additions and 1 deletion.
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})

0 comments on commit a835b22

Please sign in to comment.