#NEWLINE# def override_subcommand( section_name , section_items , args ) : #NEWLINE# #INDENT# '\n    Given a specific section in the configuration file that maps to\n    a subcommand (except for the global section) read all the keys that are\n    actual argument flags and slap the values for that one subcommand.\n\n    Return the altered ``args`` object at the end.\n    ' #NEWLINE# _boolean_states = { #NEWLINE# #INDENT# 'yes' : True , #NEWLINE# 'true' : True , #NEWLINE# 'on' : True , #NEWLINE# 'no' : False , #NEWLINE# 'false' : False , #NEWLINE# 'off' : False , #NEWLINE# #UNINDENT# } #NEWLINE# for ( k , v ) in normalized_value : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# normalized_value = v . lower ( ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# normalized_value = v #NEWLINE# #UNINDENT# value = _boolean_states . get ( normalized_value , v ) #NEWLINE# setattr ( args , k , value ) #NEWLINE# #UNINDENT# return args