surrortg.inputs.input_filters

Classes

surrortg.inputs.input_filters.spam_filter

class SpamFilter(max_inputs, per_seconds)

Bases: object

Class for adding a spam filter for any input

Only allows a certain number of inputs commands to pass through, during the specified rolling time window. :param max_inputs: maximum number of inputs allowed :type max_inputs: int :param per_seconds: time window length :type per_seconds: float

too_much_spam()

Check if input has received too many commands

Returns

‘True’ if input has received too many commands

Return type

bool