@classmethod
    def register_hook(cls, name, hook_class):
        if not name:
            raise HookRegistryError(
                "Need a name to register hook %s." % hook_class)
        elif name not in cls._REGISTRY:
            logger.debug(u'Registring hook %s', name)
            cls._REGISTRY[name] = hook_class
        else:
            if cls._REGISTRY[name] != hook_class:
                raise HookRegistryError(
                    "Cannot register two hooks with the same name.")
dataset/ETHPy150Open rbarrois/mpdlcd/mpdlcd/mpdhooks.py/HookRegistry.register_hook/original