'Updates the given defaults with values from the config files and
the environ. Does a little special handling for certain types of
options (lists).'

def update_defaults(self, defaults):

    config = {}
    for section in ('global', self.name):
        config.update(self.normalize_keys(self.get_config_section(section)))
    config.update(self.normalize_keys(self.get_environ_vars()))
    for (key, val) in config.items():
        option = self.get_option(key)
        if (option is not None):
            if (not val):
                continue
            if (option.action in ('store_true', 'store_false', 'count')):
                val = strtobool(val)
            if (option.action == 'append'):
                val = val.split()
                val = [self.check_default(option, key, v) for v in val]
            else:
                val = self.check_default(option, key, val)
            defaults[option.dest] = val
    return defaults
