From: W. Trevor King Date: Fri, 18 Jun 2010 13:01:18 +0000 (-0400) Subject: Run reload_config when initializing UIs X-Git-Url: http://git.tremily.us/?p=hooke.git;a=commitdiff_plain;h=50e1e1779501f39b0178ae4ac1748ba6960397ae Run reload_config when initializing UIs --- diff --git a/hooke/ui/__init__.py b/hooke/ui/__init__.py index 33153d4..38311b4 100644 --- a/hooke/ui/__init__.py +++ b/hooke/ui/__init__.py @@ -78,7 +78,8 @@ class UserInterface (object): """Update the user interface for new config settings. Should be called with the new `config` upon recipt of - `ReloadUserInterfaceConfig` from the `CommandEngine`. + `ReloadUserInterfaceConfig` from the `CommandEngine` or when + loading the initial configuration. """ try: self.config = dict(config.items(self.setting_section)) @@ -153,8 +154,5 @@ def load_ui(config, name=None): assert len(uis) == 1, 'Can only select one UI, not %d: %s' % (len(uis),uis) name = uis[0] ui = USER_INTERFACES[name] - try: - ui.config = dict(config.items(ui.setting_section)) - except configparser.NoSectionError: - pass + ui.reload_config(config) return ui