From 50e1e1779501f39b0178ae4ac1748ba6960397ae Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 18 Jun 2010 09:01:18 -0400 Subject: [PATCH] Run reload_config when initializing UIs --- hooke/ui/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 -- 2.26.2