#NEWLINE# def __init__( self , name , default = NULL , true_values = None , false_values = None , case_sensitive = False ) : #NEWLINE# #INDENT# if ( default is not NULL ) : #NEWLINE# #INDENT# required = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# required = True #NEWLINE# #UNINDENT# super ( Flag , self ) . __init__ ( name , default , required ) #NEWLINE# if ( true_values is None ) : #NEWLINE# #INDENT# true_values = [ ] #NEWLINE# #UNINDENT# if ( false_values is None ) : #NEWLINE# #INDENT# false_values = [ ] #NEWLINE# #UNINDENT# if case_sensitive : #NEWLINE# #INDENT# self . mod = ( lambda x : x ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . mod = ( lambda x : str ( x ) . lower ( ) ) #NEWLINE# #UNINDENT# self . true_values = [ self . mod ( tv ) for tv in true_values ] #NEWLINE# self . false_values = [ self . mod ( fv ) for fv in false_values ] #NEWLINE# if ( not any ( [ self . true_values , self . false_values ] ) ) : #NEWLINE# #INDENT# raise ImproperlyConfigured ( 'Flag must specify either true_values and/or false_values' )