From 9254ee022959f4e68af3e00a9b83df1d9c6f3dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85ke=20Forslund?= Date: Sun, 29 Sep 2019 18:39:07 +0200 Subject: [PATCH] Remove duplicate load of skill settings Instead of loading skill settings from disk twice, a copy is made into the _initial_settings member after load. --- mycroft/skills/mycroft_skill/mycroft_skill.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mycroft/skills/mycroft_skill/mycroft_skill.py b/mycroft/skills/mycroft_skill/mycroft_skill.py index ddae067025..07e3bac680 100644 --- a/mycroft/skills/mycroft_skill/mycroft_skill.py +++ b/mycroft/skills/mycroft_skill/mycroft_skill.py @@ -13,6 +13,8 @@ # limitations under the License. # """Common functionality relating to the implementation of mycroft skills.""" + +from copy import deepcopy import inspect import sys import re @@ -129,11 +131,8 @@ class MycroftSkill: # Get directory of skill self.root_dir = dirname(abspath(sys.modules[self.__module__].__file__)) if use_settings: - self._initial_settings = get_local_settings( - self.root_dir, - self.name - ) self.settings = Settings(self) + self._initial_settings = deepcopy(self.settings.as_dict()) else: self.settings = None self.settings_change_callback = None