From 4f2ab2ca8d837d86485d4ad311516164129def04 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 11 Aug 2012 01:22:57 -0400 Subject: [PATCH] Fix loading a config file after creating a new one from a semi-complete state. --- earwigbot/config/__init__.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/earwigbot/config/__init__.py b/earwigbot/config/__init__.py index c7960c1..d21cc39 100644 --- a/earwigbot/config/__init__.py +++ b/earwigbot/config/__init__.py @@ -277,15 +277,16 @@ class BotConfig(object): if not path.exists(self._config_path): self._handle_missing_config() self._load() - data = self._data - if not data: + if not self._data: self._handle_missing_config() - self.components._load(data.get("components", OrderedDict())) - self.wiki._load(data.get("wiki", OrderedDict())) - self.irc._load(data.get("irc", OrderedDict())) - self.commands._load(data.get("commands", OrderedDict())) - self.tasks._load(data.get("tasks", OrderedDict())) - self.metadata._load(data.get("metadata", OrderedDict())) + self._load() + + self.components._load(self._data.get("components", OrderedDict())) + self.wiki._load(self._data.get("wiki", OrderedDict())) + self.irc._load(self._data.get("irc", OrderedDict())) + self.commands._load(self._data.get("commands", OrderedDict())) + self.tasks._load(self._data.get("tasks", OrderedDict())) + self.metadata._load(self._data.get("metadata", OrderedDict())) self._setup_logging() if self.is_encrypted():