#NEWLINE# def ui_type_yesno( self , value = None , enum = False , reverse = False ) : #NEWLINE# #INDENT# '\n        UI parameter type helper for "Yes" and "No" boolean values.\n        "Yes" and "No" are used for boolean iSCSI session parameters.\n        ' #NEWLINE# if reverse : #NEWLINE# #INDENT# if ( value is not None ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return 'n/a' #NEWLINE# #UNINDENT# #UNINDENT# type_enum = ( 'Yes' , 'No' ) #NEWLINE# syntax = '|' . join ( type_enum ) #NEWLINE# if ( value is None ) : #NEWLINE# #INDENT# if enum : #NEWLINE# #INDENT# return type_enum #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return syntax #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( value in type_enum ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( "Syntax error, '%s' is not %s." % ( reverse , syntax ) ) )