(supported=[])
return _supported_types
Decorator to check if the incoming query is supported by the func.

    The PassiveTotal service is designed to be extremely flexible and lets a
    user run the service across a number of different types. Defining the type
    checks inside of a decorator makes processing logic simple.

    :param supported: List of supported CRITS types.
    :return: Function call or a blank, logged response.
Decorator to check if the incoming query is supported by the func.
Decorator to check if the incoming query is supported by the func .
def call_supported_types(supported=[]):
    """Decorator to check if the incoming query is supported by the func.

    The PassiveTotal service is designed to be extremely flexible and lets a
    user run the service across a number of different types. Defining the type
    checks inside of a decorator makes processing logic simple.

    :param supported: List of supported CRITS types.
    :return: Function call or a blank, logged response.
    """
    def _supported_types(f):
        def wrapper(self, *args):
            request_type = self.obj._meta['crits_type']
            if request_type not in supported:
                logger.warn("PassiveTotal: Invalid type.")
                self._warning("%s: Invalid type specified." % f.func_name)
                return
            return f(self, *args)
        return wrapper
    return _supported_types
def call_supported_types ( supported = [ ] ) : def _supported_types ( f ) : def wrapper ( self , * args ) : request_type = self . obj . _meta [ 'crits_type' ] if request_type not in supported : logger . warn ( "PassiveTotal: Invalid type." ) self . _warning ( "%s: Invalid type specified." % f . func_name ) return return f ( self , * args ) return wrapper return _supported_types