(self, key, profile='default', plugin=None, default=None)
Look up a configuration item
Look up a configuration item
Look up a configuration item
def get_item(self, key, profile='default', plugin=None, default=None):
        """Look up a configuration item"""
        if profile not in self.profiles:
            # Hitting this generally implies a bug
            profile = 'default'

        if key in self.global_config:
            dbg('ConfigBase::get_item: %s found in globals: %s' %
                    (key, self.global_config[key]))
            return(self.global_config[key])
        elif key in self.profiles[profile]:
            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 and plugin in self.plugins and key in self.plugins[plugin]:
            dbg('ConfigBase::get_item: %s found in plugin %s: %s' % (
                    key, plugin, self.plugins[plugin][key]))
            return(self.plugins[plugin][key])
        elif default:
            return default
        else:
            raise KeyError('ConfigBase::get_item: unknown key %s' % key)
def get_item ( self , key , profile = 'default' , plugin = None , default = None ) : if profile not in self . profiles : # Hitting this generally implies a bug profile = 'default' if key in self . global_config : dbg ( 'ConfigBase::get_item: %s found in globals: %s' % ( key , self . global_config [ key ] ) ) return ( self . global_config [ key ] ) elif key in self . profiles [ profile ] : 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 and plugin in self . plugins and key in self . plugins [ plugin ] : dbg ( 'ConfigBase::get_item: %s found in plugin %s: %s' % ( key , plugin , self . plugins [ plugin ] [ key ] ) ) return ( self . plugins [ plugin ] [ key ] ) elif default : return default else : raise KeyError ( 'ConfigBase::get_item: unknown key %s' % key )