#NEWLINE# def _add_role_flag( string , test , flag , cond = None , prefix = 'NO' , addtxt = '' , skip = False ) : #NEWLINE# #INDENT# if ( not skip ) : #NEWLINE# #INDENT# if ( cond is None ) : #NEWLINE# #INDENT# cond = test #NEWLINE# #UNINDENT# if ( test is not None ) : #NEWLINE# #INDENT# if cond : #NEWLINE# #INDENT# string = '{0} {1}' . format ( string , flag ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# string = '{0} {2}{1}' . format ( addtxt , flag , prefix ) #NEWLINE# #UNINDENT# #UNINDENT# if addtxt : #NEWLINE# #INDENT# string = '{0} {1}' . format ( string , addtxt ) #NEWLINE# #UNINDENT# #UNINDENT# return string