Merge pull request #1577 from MycroftAI/feature/msm-config
Add configuration values for msmpull/1578/head
commit
4d571adfbe
|
@ -86,6 +86,15 @@
|
||||||
|
|
||||||
// General skill values
|
// General skill values
|
||||||
"skills": {
|
"skills": {
|
||||||
|
"msm": {
|
||||||
|
"directory": "/opt/mycroft/skills",
|
||||||
|
"versioned": true,
|
||||||
|
"repo": {
|
||||||
|
"cache": "/opt/mycroft/.skills-repo",
|
||||||
|
"url": "https://github.com/MycroftAI/mycroft-skills",
|
||||||
|
"branch": "18.02"
|
||||||
|
}
|
||||||
|
},
|
||||||
// Directory to look for user skills
|
// Directory to look for user skills
|
||||||
"directory": "~/.mycroft/skills",
|
"directory": "~/.mycroft/skills",
|
||||||
// TODO: Old unused kludge, remove from code
|
// TODO: Old unused kludge, remove from code
|
||||||
|
|
|
@ -22,7 +22,7 @@ from threading import Timer, Thread, Event
|
||||||
import monotonic
|
import monotonic
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from os.path import exists, join, basename, dirname, expanduser, isfile
|
from os.path import exists, join, basename, dirname, expanduser, isfile
|
||||||
from msm import MycroftSkillsManager
|
from msm import MycroftSkillsManager, SkillRepo
|
||||||
|
|
||||||
import mycroft.lock
|
import mycroft.lock
|
||||||
from mycroft import dialog
|
from mycroft import dialog
|
||||||
|
@ -220,8 +220,19 @@ class SkillManager(Thread):
|
||||||
ws.on('skillmanager.update', self.schedule_now)
|
ws.on('skillmanager.update', self.schedule_now)
|
||||||
ws.on('skillmanager.list', self.send_skill_list)
|
ws.on('skillmanager.list', self.send_skill_list)
|
||||||
|
|
||||||
self.msm = MycroftSkillsManager(
|
self.msm = self.create_msm()
|
||||||
Configuration.get()['enclosure'].get('platform', 'default')
|
|
||||||
|
@staticmethod
|
||||||
|
def create_msm():
|
||||||
|
config = Configuration.get()
|
||||||
|
msm_config = config['skills']['msm']
|
||||||
|
repo_config = msm_config['repo']
|
||||||
|
platform = config['enclosure'].get('platform', 'default')
|
||||||
|
return MycroftSkillsManager(
|
||||||
|
platform=platform, skills_dir=msm_config['directory'],
|
||||||
|
repo=SkillRepo(
|
||||||
|
repo_config['cache'], repo_config['url'], repo_config['branch']
|
||||||
|
), versioned=msm_config['versioned']
|
||||||
)
|
)
|
||||||
|
|
||||||
def schedule_now(self, message=None):
|
def schedule_now(self, message=None):
|
||||||
|
|
Loading…
Reference in New Issue