djblets.integrations.hooks¶
Extension hooks for registering integrations.
- class BaseIntegrationHook(extension: Extension, *args, **kwargs)¶
Bases:
NeedsIntegrationManagerMixin
,ExtensionHook
Base class for an extension hook for integration management.
Integrations enable any supporting application to connect with third-party services in specialized ways. This class makes it easy to register new integrations on an extension, binding their lifecycles to that of the extension.
This is not intended to be used directly by a caller. Instead, a project offering integrations should subclass this and provide an implementation of
get_integration_manager()
.- integration_cls: Type[Integration]¶
The integration class being managed by the hook.
- initialize(integration_cls: Type[Integration]) None ¶
Initialize the hook.
The provided integration will be registered with the integration manager.
- Parameters:
integration_cls (
type
) – The integration class to register.
- __annotations__ = {'integration_cls': 'Type[Integration]', 'remove_hook': "Callable[['ExtensionHook', ExtensionHook], None]"}¶