Remove all references to /opt/mycroft/skills

The only thing that should reference it is the config
pull/1592/head
Matthew D. Scholefield 2018-05-14 16:58:58 -05:00 committed by Åke Forslund
parent 95525205ec
commit 14ceb1f1dd
2 changed files with 17 additions and 15 deletions

View File

@ -54,7 +54,6 @@ DEBUG = Configuration.get().get("debug", False)
skills_config = Configuration.get().get("skills")
BLACKLISTED_SKILLS = skills_config.get("blacklisted_skills", [])
PRIORITY_SKILLS = skills_config.get("priority_skills", [])
SKILLS_DIR = '/opt/mycroft/skills'
installer_config = Configuration.get().get("SkillInstallerSkill")
@ -202,9 +201,12 @@ class SkillManager(Thread):
self.enclosure = EnclosureAPI(ws)
# Schedule install/update of default skill
self.msm = self.create_msm()
self.num_install_retries = 0
self.update_interval = Configuration.get()['skills']['update_interval']
self.update_interval = int(self.update_interval * 60 * MINUTES)
self.dot_msm = join(SKILLS_DIR, '.msm')
self.dot_msm = join(self.msm.skills_dir, '.msm')
if exists(self.dot_msm):
self.next_download = os.path.getmtime(self.dot_msm) + \
self.update_interval
@ -222,9 +224,6 @@ class SkillManager(Thread):
ws.on('skillmanager.update', self.schedule_now)
ws.on('skillmanager.list', self.send_skill_list)
self.msm = self.create_msm()
self.num_install_retries = 0
@staticmethod
def create_msm():
config = Configuration.get()
@ -432,7 +431,7 @@ class SkillManager(Thread):
# Look for recently changed skill(s) needing a reload
# checking skills dir and getting all skills there
skill_paths = glob(join(SKILLS_DIR, '*/'))
skill_paths = glob(join(self.msm.skills_dir, '*/'))
still_loading = False
for skill_path in skill_paths:
still_loading = (

View File

@ -20,13 +20,12 @@ from os.path import exists
import sys
import imp
from mycroft.configuration import Configuration
from test.integrationtests.skills.skill_tester import MockSkillsLoader
from test.integrationtests.skills.skill_tester import SkillTest
SKILL_PATH = '/opt/mycroft/skills/'
def discover_tests():
def discover_tests(skills_dir):
""" Find all tests for the skills in the default skill path,
or in the path provided as the LAST command line argument.
@ -36,13 +35,10 @@ def discover_tests():
Returns:
Tests, lists of (intent example, test environment)
"""
global SKILL_PATH
if len(sys.argv) > 2:
SKILL_PATH = sys.argv.pop()
tests = {}
skills = [
skill for skill
in glob.glob(SKILL_PATH + '/*')
in glob.glob(skills_dir + '/*')
if os.path.isdir(skill)
]
@ -66,8 +62,15 @@ def discover_tests():
return tests
tests = discover_tests()
loader = MockSkillsLoader(SKILL_PATH)
def get_skills_dir():
if len(sys.argv) > 1:
return sys.argv[1]
return Configuration.get()['skills']['msm']['directory']
skills_dir = get_skills_dir()
tests = discover_tests(skills_dir)
loader = MockSkillsLoader(skills_dir)
emitter = loader.load_skills()