diff --git a/mycroft/skills/container.py b/mycroft/skills/container.py index 85a8e5c92a..a4f34db431 100644 --- a/mycroft/skills/container.py +++ b/mycroft/skills/container.py @@ -88,7 +88,7 @@ class SkillContainer(object): def stop(self): if self.skill: - self.skill.shutdown() + self.skill._shutdown() def main(): diff --git a/mycroft/skills/core.py b/mycroft/skills/core.py index ab47e37217..5c39946b11 100644 --- a/mycroft/skills/core.py +++ b/mycroft/skills/core.py @@ -882,6 +882,11 @@ class MycroftSkill(object): process termination. The skill implementation must shutdown all processes and operations in execution. """ + pass + + def _shutdown(self): + """Parent function called internally to shut down everything""" + self.shutdown() # Store settings self.settings.store() self.settings.is_alive = False @@ -1154,9 +1159,9 @@ class FallbackSkill(MycroftSkill): handler = self.instance_fallback_handlers.pop() self.remove_fallback(handler) - def shutdown(self): + def _shutdown(self): """ Remove all registered handlers and perform skill shutdown. """ self.remove_instance_handlers() - super(FallbackSkill, self).shutdown() + super(FallbackSkill, self)._shutdown() diff --git a/mycroft/skills/main.py b/mycroft/skills/main.py index e8345fb614..5c51d1b1da 100644 --- a/mycroft/skills/main.py +++ b/mycroft/skills/main.py @@ -378,7 +378,7 @@ class SkillManager(Thread): LOG.debug("Reloading Skill: " + skill_folder) # removing listeners and stopping threads try: - skill["instance"].shutdown() + skill["instance"]._shutdown() except Exception: LOG.exception("An error occured while shutting down {}" .format(skill["instance"].name)) @@ -503,7 +503,7 @@ class SkillManager(Thread): instance = skill_info.get('instance') if instance: try: - instance.shutdown() + instance._shutdown() except Exception: LOG.exception('Shutting down skill: ' + name) diff --git a/test/integrationtests/skills/skill_tester.py b/test/integrationtests/skills/skill_tester.py index 6aeb8f316d..33ab776acb 100644 --- a/test/integrationtests/skills/skill_tester.py +++ b/test/integrationtests/skills/skill_tester.py @@ -61,7 +61,7 @@ def load_skills(emitter, skills_root): def unload_skills(skills): for s in skills: - s.shutdown() + s._shutdown() class RegistrationOnlyEmitter(object):