Jump to >

djblets.integrations.hooks

Extension hooks for registering integrations.

class BaseIntegrationHook(extension, *args, **kwargs)[source]

Bases: djblets.integrations.mixins.NeedsIntegrationManagerMixin, djblets.extensions.hooks.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().

initialize(integration_cls)[source]

Initialize the hook.

The provided integration will be registered with the integration manager.

Parameters:integration_cls (type) – The integration class to register.
shutdown()[source]

Shut down the hook.

The integration registered in this hook will be unregistered.