def update_defaults(self, defaults):
<EOL>config = {}<EOL>config.update(dict(self.get_config_section('<STR_LIT>')))<EOL>config.update(dict(self.get_environ_vars()))<EOL>for key, val in config.items():<EOL><INDENT>key = key.replace('<STR_LIT:_>', '<STR_LIT:->')<EOL>if not key.startswith('<STR_LIT>'):<EOL><INDENT>key = '<STR_LIT>' % key  <EOL><DEDENT>option = self.get_option(key)<EOL>if option is not None:<EOL><INDENT>if not val:<EOL><INDENT>continue<EOL><DEDENT>if option.action == '<STR_LIT>':<EOL><INDENT>val = val.split()<EOL><DEDENT>else:<EOL><INDENT>option.nargs = <NUM_LIT:1><EOL><DEDENT>if option.action == '<STR_LIT>':<EOL><INDENT>val = not strtobool(val)<EOL><DEDENT>elif option.action in ('<STR_LIT:store_true>', '<STR_LIT:count>'):<EOL><INDENT>val = strtobool(val)<EOL><DEDENT>try:<EOL><INDENT>val = option.convert_value(key, val)<EOL><DEDENT>except optparse.OptionValueError:<EOL><INDENT>e = sys.exc_info()[<NUM_LIT:1>]<EOL>print("<STR_LIT>" % e)<EOL>sys.exit(<NUM_LIT:3>)<EOL><DEDENT>defaults[option.dest] = val<EOL><DEDENT><DEDENT>return defaults<EOL>
Updates the given defaults with values from the config files and
the environ. Does a little special handling for certain types of
options (lists).