cowbird.handlers.handler

Attributes

AnyHandlerParameter

HANDLER_PRIORITY_PARAM

HANDLER_URL_PARAM

HANDLER_WORKSPACE_DIR_PARAM

HANDLER_PARAMETERS

LOGGER

Exceptions

HandlerConfigurationException

Exception thrown when a handler cannot be instantiated because of a bad configuration.

Classes

Handler

Helper class that provides a standard way to create an ABC using

Module Contents

cowbird.handlers.handler.AnyHandlerParameter[source]
cowbird.handlers.handler.HANDLER_PRIORITY_PARAM: AnyHandlerParameter = 'priority'[source]
cowbird.handlers.handler.HANDLER_URL_PARAM: AnyHandlerParameter = 'url'[source]
cowbird.handlers.handler.HANDLER_WORKSPACE_DIR_PARAM: AnyHandlerParameter = 'workspace_dir'[source]
cowbird.handlers.handler.HANDLER_PARAMETERS[source]
cowbird.handlers.handler.LOGGER[source]
exception cowbird.handlers.handler.HandlerConfigurationException[source]

Bases: Exception

Exception thrown when a handler cannot be instantiated because of a bad configuration.

Initialize self. See help(type(self)) for accurate signature.

class cowbird.handlers.handler.Handler(settings: cowbird.typedefs.SettingsType, name: str, **kwargs: Any)[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:
  • settings – Cowbird settings for convenience

  • name – Handler name

  • kwargs – The base class handle, but doesn’t require the following variables:

  • url – Location of the web service represented by the cowbird handler

  • workspace_dir – Workspace directory

  • priority – Relative priority between handlers while handling events. Lower value has higher priority, default value is last.

__slots__[source]

Handler interface used to notify implemented handlers of users/permissions changes.

Todo

At some point we will need a consistency function that goes through all Magpie users and make sure that handlers are up-to-date.

property required_params: List[AnyHandlerParameter][source]
Abstractmethod:

settings[source]
name[source]
priority[source]
url[source]
workspace_dir[source]
ssl_verify[source]
timeout[source]
json() cowbird.typedefs.JSON[source]
_user_workspace_dir(user_name: str) str[source]
abstract user_created(user_name: str) None[source]
abstract user_deleted(user_name: str) None[source]
abstract permission_created(permission: cowbird.permissions_synchronizer.Permission) None[source]
abstract permission_deleted(permission: cowbird.permissions_synchronizer.Permission) None[source]
abstract resync() None[source]