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.
pull/2336/head
Åke Forslund 2019-09-29 18:39:07 +02:00
parent 87ee92d4f5
commit 9254ee0229
1 changed files with 3 additions and 4 deletions

View File

@ -13,6 +13,8 @@
# limitations under the License. # limitations under the License.
# #
"""Common functionality relating to the implementation of mycroft skills.""" """Common functionality relating to the implementation of mycroft skills."""
from copy import deepcopy
import inspect import inspect
import sys import sys
import re import re
@ -129,11 +131,8 @@ class MycroftSkill:
# Get directory of skill # Get directory of skill
self.root_dir = dirname(abspath(sys.modules[self.__module__].__file__)) self.root_dir = dirname(abspath(sys.modules[self.__module__].__file__))
if use_settings: if use_settings:
self._initial_settings = get_local_settings(
self.root_dir,
self.name
)
self.settings = Settings(self) self.settings = Settings(self)
self._initial_settings = deepcopy(self.settings.as_dict())
else: else:
self.settings = None self.settings = None
self.settings_change_callback = None self.settings_change_callback = None