Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Commit c27cff4

Browse files
author
Ryan Sipes
authored
Merge pull request #168 from the7erm/feature/issue-161
Feature/issue 161
2 parents ddcedae + 4f6b2ab commit c27cff4

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

mycroft/configuration/mycroft.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ lang = "en-us"
44
location = "Lawrence, Kansas"
55
time.format = "%A, %B %d, %Y at %H:%M"
66
stop_threshold = 2 # in seconds
7+
third_party_skills_dir = "~/.mycroft/third_party_skills"
78

89
[messagebus_service]
910
host = ""

mycroft/skills/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
PRIMARY_SKILLS = ['intent', 'wake']
3838
BLACKLISTED_SKILLS = ["send_sms"]
3939
SKILLS_BASEDIR = dirname(__file__)
40+
THIRD_PARTY_SKILLS_DIR = "/opt/mycroft/third_party"
4041

4142
MainModule = '__init__'
4243

mycroft/skills/main.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717

1818

1919
import json
20+
from os.path import join, expanduser, exists
2021

22+
from mycroft.configuration import ConfigurationManager
2123
from mycroft.messagebus.client.ws import WebsocketClient
22-
from mycroft.skills.core import load_skills
24+
from mycroft.skills.core import load_skills, THIRD_PARTY_SKILLS_DIR
2325
from mycroft.util.log import getLogger
2426
logger = getLogger("Skills")
2527

@@ -31,6 +33,20 @@
3133
def load_skills_callback():
3234
global client
3335
load_skills(client)
36+
config = ConfigurationManager.get()
37+
config_core = config.get("core")
38+
39+
try:
40+
ini_third_party_skills_dir = expanduser(
41+
config_core.get("third_party_skills_dir"))
42+
except AttributeError as e:
43+
logger.warning(e.message)
44+
45+
if exists(THIRD_PARTY_SKILLS_DIR):
46+
load_skills(client, THIRD_PARTY_SKILLS_DIR)
47+
48+
if ini_third_party_skills_dir and exists(ini_third_party_skills_dir):
49+
load_skills(client, ini_third_party_skills_dir)
3450

3551

3652
def connect():

0 commit comments

Comments
 (0)