#NEWLINE# def rule_action( label = None , params = None ) : #NEWLINE# #INDENT# ' Decorator to make a function into a rule action\n    ' #NEWLINE# def wrapper( func ) : #NEWLINE# #INDENT# params_ = params #NEWLINE# if isinstance ( params , dict ) : #NEWLINE# #INDENT# params_ = [ dict ( label = fn_name_to_pretty_label ( name ) , name = name , fieldType = field_type ) for ( name , field_type ) in params . items ( ) ] #NEWLINE# #UNINDENT# _validate_action_parameters ( func , params_ ) #NEWLINE# func . is_rule_action = True #NEWLINE# func . label = ( label or fn_name_to_pretty_label ( func . __name__ ) ) #NEWLINE# func . params = params_ #NEWLINE# return func #NEWLINE# #UNINDENT# return wrapper