Пример #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()
Пример #3
0
def _register():
    for command in _COMMANDS:
        command_registry().register(_local(command), command,
                                    help_text=_HELP[command],
                                    see_also=_SEE_ALSO[command])
        remote_registry.register(_remote(command), command)