#479 - Cleaning up all skills on stop process

- On stop mycroft-core executing cleanup of all skills
pull/446/merge
Augusto Monteiro 2017-01-27 00:00:37 -03:00
parent eb2e88a6aa
commit 8815327dc0
1 changed files with 11 additions and 4 deletions

View File

@ -29,11 +29,13 @@ logger = getLogger("Skills")
__author__ = 'seanfitz'
ws = None
skills = []
def load_skills_callback():
global ws
load_skills(ws)
global skills
skills += load_skills(ws)
config = ConfigurationManager.get().get("skills")
try:
@ -43,10 +45,10 @@ def load_skills_callback():
for loc in THIRD_PARTY_SKILLS_DIR:
if exists(loc):
load_skills(client, loc)
skills += load_skills(client, loc)
if ini_third_party_skills_dir and exists(ini_third_party_skills_dir):
load_skills(ws, ini_third_party_skills_dir)
skills += load_skills(ws, ini_third_party_skills_dir)
def connect():
@ -77,4 +79,9 @@ def main():
if __name__ == "__main__":
main()
try:
main()
except KeyboardInterrupt:
for skill in skills:
skill.cleanup()