Merge pull request #550 from JarbasAI/patch-3

load intent skill first #552
pull/563/head
Augusto Monteiro 2017-03-14 11:43:39 -05:00 committed by GitHub
commit 621faef118
1 changed files with 16 additions and 1 deletions

View File

@ -39,6 +39,7 @@ loaded_skills = {}
last_modified_skill = 0
skills_directories = []
skill_reload_thread = None
prioritary_skills = ["intent"]
def connect():
@ -81,7 +82,21 @@ def clear_skill_events(instance):
def watch_skills():
global ws, loaded_skills, last_modified_skill, skills_directories
global ws, loaded_skills, last_modified_skill, skills_directories, id_counter, \
prioritary_skills
# load prioritary skills first
for p_skill in prioritary_skills:
if p_skill not in loaded_skills:
loaded_skills[p_skill] = {}
skill = loaded_skills.get(p_skill)
skill["path"] = os.path.join(os.path.dirname(__file__), p_skill)
if not MainModule + ".py" in os.listdir(skill["path"]):
logger.error(p_skill + " does not appear to be a skill")
sys.exit(1)
skill["loaded"] = True
skill["instance"] = load_skill(
create_skill_descriptor(skill["path"]), ws)
while True:
for dir in skills_directories:
if exists(dir):