Cleaning up all skills on stop process
On stop mycroft-core executing cleanup of all skills
@@ -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__":
+ try:
main()
+ except KeyboardInterrupt:
+ for skill in skills:
+ skill.cleanup()
+
