#NEWLINE# def _add_option_value( self ) : #NEWLINE# #INDENT# for options in self . options . values ( ) : #NEWLINE# #INDENT# for each in options : #NEWLINE# #INDENT# option = each [ 0 ] #NEWLINE# names = option . names #NEWLINE# default = option . default #NEWLINE# this_value = options . value #NEWLINE# logger . debug ( '%s/%s/%s' , option , default , this_value ) #NEWLINE# name_in_value = names . intersection ( self ) #NEWLINE# if name_in_value : #NEWLINE# #INDENT# one_name = name_in_value . pop ( ) #NEWLINE# logger . debug ( 'in names, pop %s, self %s' , one_name , self ) #NEWLINE# value_in_usage = self [ one_name ] #NEWLINE# if ( not value_in_usage ) : #NEWLINE# #INDENT# if ( default is None ) : #NEWLINE# #INDENT# final_value = value_in_usage #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( each . repeat or ( ( value_in_usage is not True ) and ( value_in_usage is not False ) and isinstance ( value_in_usage , ( int , list ) ) ) ) : #NEWLINE# #INDENT# final_value = default . split ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# final_value = default #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# final_value = value_in_usage #NEWLINE# #UNINDENT# if ( ( option . ref is None ) and each . repeat ) : #NEWLINE# #INDENT# final_value = int ( ( final_value or 0 ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if self . appeared_only : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ref = option . ref #NEWLINE# if ( default is not None ) : #NEWLINE# #INDENT# if ( each . repeat or ( ( this_value not in ( True , False ) ) and isinstance ( this_value , ( int , list ) ) ) ) : #NEWLINE# #INDENT# final_value = default . split ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( ref is not None ) and ( max ( ref . arg_range ( ) ) > 1 ) ) : #NEWLINE# #INDENT# final_value = default . split ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# final_value = default #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ref is not None ) : #NEWLINE# #INDENT# arg_range = ref . arg_range ( ) #NEWLINE# if ( max ( arg_range ) == 1 ) : #NEWLINE# #INDENT# final_value = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( max ( arg_range ) > 1 ) #NEWLINE# final_value = [ ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( this_value is None ) : #NEWLINE# #INDENT# final_value = ( 0 if each . repeat else False ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# final_value = ( int ( this_value ) if each . repeat else this_value ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# logger . debug ( 'set %s value %s' , names , final_value ) #NEWLINE# final = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for name in names : #NEWLINE# #INDENT# final [ name ] = final_value #NEWLINE# #UNINDENT# self . update ( final )