Skip to content

Commit

Permalink
reload skill functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Apr 11, 2018
1 parent 09715c2 commit 7a8e232
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pip
from git import Repo
from git.cmd import Git
from time import sleep


__author__ = "JarbasAI"
Expand Down Expand Up @@ -417,6 +418,18 @@ def update_skills_config(self, config=None):
conf['skills'] = config or self.skills_config
conf.store()

def reload_skill(self, skill_name):
skill_folder = self.match_name_to_folder(skill_name)
if skill_folder is None:
LOG.error("Could not find skill to reload: " + skill_name)
return False
path = self.skills[skill_folder]["path"]+"/reloading"
with open(path, "w") as f:
f.write(" ")
sleep(2)
remove(path)
return True


class JarbasSkillsManager(MycroftSkillsManager):
SKILLS_MODULES = "https://raw.githubusercontent.com/JarbasAl/jarbas_skills_repo/master/"
Expand Down

0 comments on commit 7a8e232

Please sign in to comment.