#NEWLINE# def get_choice_opt( options , optname , allowed , default = None , normcase = False ) : #NEWLINE# #INDENT# string = options . get ( optname , default ) #NEWLINE# if normcase : #NEWLINE# #INDENT# string = string . lower ( ) #NEWLINE# #UNINDENT# if ( string not in allowed ) : #NEWLINE# #INDENT# raise OptionError ( ( 'Value for option %s must be one of %s' % ( options , ', ' . join ( map ( str , allowed ) ) ) ) ) #NEWLINE# #UNINDENT# return string