two lines of debugging for each Config() lookup is mad, drop it to one

This commit is contained in:
Chris Jones 2010-01-10 23:47:15 +00:00
parent 27d0a13330
commit 976e3124f7
1 changed files with 6 additions and 7 deletions

View File

@ -427,20 +427,19 @@ class ConfigBase(Borg):
def get_item(self, key, profile='default', plugin=None):
"""Look up a configuration item"""
dbg('ConfigBase::get_item: %s:%s' % (profile, key))
if self.global_config.has_key(key):
dbg('ConfigBase::get_item: found in globals: %s' %
self.global_config[key])
dbg('ConfigBase::get_item: %s found in globals: %s' %
(key, self.global_config[key]))
return(self.global_config[key])
elif self.profiles[profile].has_key(key):
dbg('ConfigBase::get_item: found in profile %s (%s)' % (
profile, self.profiles[profile][key]))
dbg('ConfigBase::get_item: %s found in profile %s: %s' % (
key, profile, 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 (%s)' % (
plugin, self.plugins[plugin][key]))
dbg('ConfigBase::get_item: %s found in plugin %s: %s' % (
key, plugin, self.plugins[plugin][key]))
return(self.plugins[plugin][key])
else:
raise KeyError('ConfigBase::get_item: unknown key %s' % key)