org.directives
Attributes
Classes
Register a cronjob. |
|
Register an export. |
|
Registers a user link group. |
|
Registers a directory search widget. |
|
Registers a text search widget. |
|
Registers a settings view. |
|
Registers a boardlet on the Dashboard. |
Module Contents
- class org.directives.HomepageWidgetAction(tag: str)[source]
Bases:
dectate.Action
Register a cronjob.
- config[source]
Describe configuration.
A dict mapping configuration names to factory functions. The resulting configuration objects are passed into
Action.identifier()
,Action.discriminators()
,Action.perform()
, andAction.before()
andAction.after()
.After commit completes, the configured objects are found as attributes on
App.config
.
- identifier(homepage_widget_registry: dict[str, RegisteredHomepageWidget]) str [source]
Returns an immutable that uniquely identifies this config.
Needs to be implemented by the
Action
subclass.Used for overrides and conflict detection.
If two actions in the same group have the same identifier in the same configurable, those two actions are in conflict and a
ConflictError
is raised duringcommit()
.If an action in an extending configurable has the same identifier as the configurable being extended, that action overrides the original one in the extending configurable.
- Parameters:
**kw – a dictionary of configuration objects as specified by the
config
class attribute.- Returns:
an immutable value uniquely identifying this action.
- perform(func: Callable[[], HomepageWidget], homepage_widget_registry: dict[str, RegisteredHomepageWidget]) None [source]
Do whatever configuration is needed for
obj
.Needs to be implemented by the
Action
subclass.Raise a
DirectiveError
to indicate that the action cannot be performed due to incorrect configuration.- Parameters:
obj – the object that the action should be performed for. Typically a function or a class object.
**kw – a dictionary of configuration objects as specified by the
config
class attribute.
- class org.directives.ExportAction(id: str, **kwargs: Any)[source]
Bases:
dectate.Action
Register an export.
- config[source]
Describe configuration.
A dict mapping configuration names to factory functions. The resulting configuration objects are passed into
Action.identifier()
,Action.discriminators()
,Action.perform()
, andAction.before()
andAction.after()
.After commit completes, the configured objects are found as attributes on
App.config
.
- identifier(export_registry: dict[str, Any]) str [source]
Returns an immutable that uniquely identifies this config.
Needs to be implemented by the
Action
subclass.Used for overrides and conflict detection.
If two actions in the same group have the same identifier in the same configurable, those two actions are in conflict and a
ConflictError
is raised duringcommit()
.If an action in an extending configurable has the same identifier as the configurable being extended, that action overrides the original one in the extending configurable.
- Parameters:
**kw – a dictionary of configuration objects as specified by the
config
class attribute.- Returns:
an immutable value uniquely identifying this action.
- perform(cls: Callable[..., Any], export_registry: dict[str, Any]) None [source]
Do whatever configuration is needed for
obj
.Needs to be implemented by the
Action
subclass.Raise a
DirectiveError
to indicate that the action cannot be performed due to incorrect configuration.- Parameters:
obj – the object that the action should be performed for. Typically a function or a class object.
**kw – a dictionary of configuration objects as specified by the
config
class attribute.
- class org.directives.UserlinkAction[source]
Bases:
dectate.Action
Registers a user link group.
- config[source]
Describe configuration.
A dict mapping configuration names to factory functions. The resulting configuration objects are passed into
Action.identifier()
,Action.discriminators()
,Action.perform()
, andAction.before()
andAction.after()
.After commit completes, the configured objects are found as attributes on
App.config
.
- identifier(linkgroup_registry: list[LinkGroupFactory]) int [source]
Returns an immutable that uniquely identifies this config.
Needs to be implemented by the
Action
subclass.Used for overrides and conflict detection.
If two actions in the same group have the same identifier in the same configurable, those two actions are in conflict and a
ConflictError
is raised duringcommit()
.If an action in an extending configurable has the same identifier as the configurable being extended, that action overrides the original one in the extending configurable.
- Parameters:
**kw – a dictionary of configuration objects as specified by the
config
class attribute.- Returns:
an immutable value uniquely identifying this action.
- perform(func: LinkGroupFactory, linkgroup_registry: list[LinkGroupFactory]) None [source]
Do whatever configuration is needed for
obj
.Needs to be implemented by the
Action
subclass.Raise a
DirectiveError
to indicate that the action cannot be performed due to incorrect configuration.- Parameters:
obj – the object that the action should be performed for. Typically a function or a class object.
**kw – a dictionary of configuration objects as specified by the
config
class attribute.
- class org.directives.DirectorySearchWidgetAction(name: str)[source]
Bases:
dectate.Action
Registers a directory search widget.
- config[source]
Describe configuration.
A dict mapping configuration names to factory functions. The resulting configuration objects are passed into
Action.identifier()
,Action.discriminators()
,Action.perform()
, andAction.before()
andAction.after()
.After commit completes, the configured objects are found as attributes on
App.config
.
- identifier(directory_search_widget_registry: DirectorySearchWidgetRegistry) str [source]
Returns an immutable that uniquely identifies this config.
Needs to be implemented by the
Action
subclass.Used for overrides and conflict detection.
If two actions in the same group have the same identifier in the same configurable, those two actions are in conflict and a
ConflictError
is raised duringcommit()
.If an action in an extending configurable has the same identifier as the configurable being extended, that action overrides the original one in the extending configurable.
- Parameters:
**kw – a dictionary of configuration objects as specified by the
config
class attribute.- Returns:
an immutable value uniquely identifying this action.
- perform(cls: type[DirectorySearchWidget[Any]], directory_search_widget_registry: DirectorySearchWidgetRegistry) None [source]
Do whatever configuration is needed for
obj
.Needs to be implemented by the
Action
subclass.Raise a
DirectiveError
to indicate that the action cannot be performed due to incorrect configuration.- Parameters:
obj – the object that the action should be performed for. Typically a function or a class object.
**kw – a dictionary of configuration objects as specified by the
config
class attribute.
- class org.directives.EventSearchWidgetAction(name: str)[source]
Bases:
dectate.Action
Registers a text search widget.
- config[source]
Describe configuration.
A dict mapping configuration names to factory functions. The resulting configuration objects are passed into
Action.identifier()
,Action.discriminators()
,Action.perform()
, andAction.before()
andAction.after()
.After commit completes, the configured objects are found as attributes on
App.config
.
- identifier(event_search_widget_registry: EventSearchWidgetRegistry) str [source]
Returns an immutable that uniquely identifies this config.
Needs to be implemented by the
Action
subclass.Used for overrides and conflict detection.
If two actions in the same group have the same identifier in the same configurable, those two actions are in conflict and a
ConflictError
is raised duringcommit()
.If an action in an extending configurable has the same identifier as the configurable being extended, that action overrides the original one in the extending configurable.
- Parameters:
**kw – a dictionary of configuration objects as specified by the
config
class attribute.- Returns:
an immutable value uniquely identifying this action.
- perform(cls: type[EventSearchWidget], event_search_widget_registry: EventSearchWidgetRegistry) None [source]
Do whatever configuration is needed for
obj
.Needs to be implemented by the
Action
subclass.Raise a
DirectiveError
to indicate that the action cannot be performed due to incorrect configuration.- Parameters:
obj – the object that the action should be performed for. Typically a function or a class object.
**kw – a dictionary of configuration objects as specified by the
config
class attribute.
- class org.directives.SettingsView(name: str, title: str, order: int = 0, icon: str = 'fa-cogs')[source]
Bases:
dectate.Action
Registers a settings view.
- config[source]
Describe configuration.
A dict mapping configuration names to factory functions. The resulting configuration objects are passed into
Action.identifier()
,Action.discriminators()
,Action.perform()
, andAction.before()
andAction.after()
.After commit completes, the configured objects are found as attributes on
App.config
.
- identifier(settings_view_registry: dict[str, SettingsDict]) str [source]
Returns an immutable that uniquely identifies this config.
Needs to be implemented by the
Action
subclass.Used for overrides and conflict detection.
If two actions in the same group have the same identifier in the same configurable, those two actions are in conflict and a
ConflictError
is raised duringcommit()
.If an action in an extending configurable has the same identifier as the configurable being extended, that action overrides the original one in the extending configurable.
- Parameters:
**kw – a dictionary of configuration objects as specified by the
config
class attribute.- Returns:
an immutable value uniquely identifying this action.
- perform(func: Any, settings_view_registry: dict[str, SettingsDict]) None [source]
Do whatever configuration is needed for
obj
.Needs to be implemented by the
Action
subclass.Raise a
DirectiveError
to indicate that the action cannot be performed due to incorrect configuration.- Parameters:
obj – the object that the action should be performed for. Typically a function or a class object.
**kw – a dictionary of configuration objects as specified by the
config
class attribute.
- class org.directives.Boardlet(name: str, order: tuple[int, int])[source]
Bases:
dectate.Action
Registers a boardlet on the Dashboard.
- config[source]
Describe configuration.
A dict mapping configuration names to factory functions. The resulting configuration objects are passed into
Action.identifier()
,Action.discriminators()
,Action.perform()
, andAction.before()
andAction.after()
.After commit completes, the configured objects are found as attributes on
App.config
.
- identifier(boardlets_registry: dict[str, BoardletConfig]) str [source]
Returns an immutable that uniquely identifies this config.
Needs to be implemented by the
Action
subclass.Used for overrides and conflict detection.
If two actions in the same group have the same identifier in the same configurable, those two actions are in conflict and a
ConflictError
is raised duringcommit()
.If an action in an extending configurable has the same identifier as the configurable being extended, that action overrides the original one in the extending configurable.
- Parameters:
**kw – a dictionary of configuration objects as specified by the
config
class attribute.- Returns:
an immutable value uniquely identifying this action.
- perform(func: type[onegov.org.models.Boardlet], boardlets_registry: dict[str, BoardletConfig]) None [source]
Do whatever configuration is needed for
obj
.Needs to be implemented by the
Action
subclass.Raise a
DirectiveError
to indicate that the action cannot be performed due to incorrect configuration.- Parameters:
obj – the object that the action should be performed for. Typically a function or a class object.
**kw – a dictionary of configuration objects as specified by the
config
class attribute.