Browse Source

Fix loading a config file after creating a new one from a semi-complete state.

tags/v0.1^2
Ben Kurtovic 12 years ago
parent
commit
4f2ab2ca8d
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      earwigbot/config/__init__.py

+ 9
- 8
earwigbot/config/__init__.py View File

@@ -277,15 +277,16 @@ class BotConfig(object):
if not path.exists(self._config_path): if not path.exists(self._config_path):
self._handle_missing_config() self._handle_missing_config()
self._load() self._load()
data = self._data
if not data:
if not self._data:
self._handle_missing_config() 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() self._setup_logging()
if self.is_encrypted(): if self.is_encrypted():


Loading…
Cancel
Save