예제 #1
0
def execute(instance, **data):
    try:
        data_type = data.pop('type')
        function = REGISTRY.function(data_type)
        if not function:
            raise Exception("Didn't understand data type %s" % type)

        return function(instance, data_type=type, **data)

    except Exception:
        LOGGER.error()
예제 #2
0
def execute(instance, **data):
    try:
        data_type = data.pop('type')
        function = REGISTRY.function(data_type)
        if not function:
            raise Exception("Didn't understand data type %s" % type)

        return function(instance, data_type=type, **data)

    except Exception:
        LOGGER.error()