From 8d3158c152f59f1ab11ad955814f350585569f29 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 22 Dec 2009 00:32:21 +0000 Subject: [PATCH] Make ConfigBase() do some debugging. Hugely verbose, but potentially very useful for now --- terminatorlib/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index ccab3e50..b40af7cc 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -29,6 +29,7 @@ Classes relating to configuration import platform from borg import Borg +from util import dbg DEFAULTS = { 'global': { @@ -209,13 +210,21 @@ class ConfigBase(Borg, dict): def get_item(self, key, profile='default', plugin=None): """Look up a configuration item""" + dbg('ConfigBase::get_item: Lookup %s (profile=%s, plugin=%s)' % (key, + profile, plugin)) if self.global_config.has_key(key): + dbg('ConfigBase::get_item: found in globals: %s' % + self.global_config[key]) return(self.global_config[key]) elif self.profiles['default'].has_key(key): + dbg('ConfigBase::get_item: found in profile: %s' % + self.profiles[profile][key]) return(self.profiles[profile][key]) elif key == 'keybindings': return(self.keybindings) elif plugin is not None and self.plugins[plugin].has_key(key): + dbg('ConfigBase::get_item: found in plugin: %s' % + self.plugins[plugin][key]) return(self.plugins[plugin][key]) else: raise KeyError('ConfigBase::get_item: unknown key %s' % key)