|
27 | 27 | from mycroft.configuration import Configuration |
28 | 28 | from mycroft.configuration.ovos import is_using_xdg |
29 | 29 | from combo_lock import ComboLock |
30 | | -from mycroft.util.log import LOG |
31 | | -from mycroft.util.file_utils import get_temp_path |
32 | | -from mycroft.configuration import BASE_FOLDER |
33 | 30 |
|
34 | 31 | from mock_msm import \ |
35 | 32 | MycroftSkillsManager as MockMSM, \ |
36 | 33 | SkillRepo as MockSkillRepo |
37 | 34 |
|
| 35 | +from ovos_utils.configuration import get_xdg_base |
| 36 | +from mycroft.util.file_utils import get_temp_path |
| 37 | +from mycroft.util.log import LOG |
| 38 | + |
38 | 39 | try: |
39 | 40 | from msm.exceptions import MsmException |
40 | 41 | from msm import MycroftSkillsManager, SkillRepo |
@@ -70,16 +71,16 @@ def get_skills_directory(conf=None): |
70 | 71 | # if xdg is disabled, ignore it! |
71 | 72 | elif not is_using_xdg(): |
72 | 73 | # old style mycroft-core skills path definition |
73 | | - data_dir = conf.get("data_dir") or "/opt/" + BASE_FOLDER |
| 74 | + data_dir = conf.get("data_dir") or "/opt/" + get_xdg_base() |
74 | 75 | folder = conf["skills"].get("msm", {}).get("directory", "skills") |
75 | 76 | skills_folder = path.join(data_dir, folder) |
76 | 77 | else: |
77 | | - skills_folder = xdg.BaseDirectory.save_data_path(BASE_FOLDER + '/skills') |
| 78 | + skills_folder = xdg.BaseDirectory.save_data_path(get_xdg_base() + '/skills') |
78 | 79 | # create folder if needed |
79 | 80 | try: |
80 | 81 | makedirs(skills_folder, exist_ok=True) |
81 | 82 | except PermissionError: # old style /opt/mycroft/skills not available |
82 | | - skills_folder = xdg.BaseDirectory.save_data_path(BASE_FOLDER + '/skills') |
| 83 | + skills_folder = xdg.BaseDirectory.save_data_path(get_xdg_base() + '/skills') |
83 | 84 | makedirs(skills_folder, exist_ok=True) |
84 | 85 |
|
85 | 86 | return path.expanduser(skills_folder) |
@@ -109,7 +110,7 @@ def build_msm_config(device_config: dict) -> MsmConfig: |
109 | 110 | msm_config = device_config['skills'].get('msm', {}) |
110 | 111 | msm_repo_config = msm_config.get('repo', {}) |
111 | 112 | enclosure_config = device_config.get('enclosure', {}) |
112 | | - data_dir = path.expanduser(device_config.get('data_dir', xdg.BaseDirectory.save_data_path(BASE_FOLDER))) |
| 113 | + data_dir = path.expanduser(device_config.get('data_dir', xdg.BaseDirectory.save_data_path(get_xdg_base()))) |
113 | 114 | skills_dir = get_skills_directory(device_config) |
114 | 115 | old_skills_dir = path.join(data_dir, msm_config.get('directory', "skills")) |
115 | 116 |
|
|
0 commit comments