org.directives ============== .. py:module:: org.directives Attributes ---------- .. autoapisummary:: org.directives.DirectoryEntryT Classes ------- .. autoapisummary:: org.directives.HomepageWidgetAction org.directives.ExportAction org.directives.UserlinkAction org.directives.DirectorySearchWidgetAction org.directives.EventSearchWidgetAction org.directives.SettingsView org.directives.Boardlet Module Contents --------------- .. py:data:: DirectoryEntryT .. py:class:: HomepageWidgetAction(tag: str) Bases: :py:obj:`dectate.Action` Register a cronjob. .. py:attribute:: config Describe configuration. A dict mapping configuration names to factory functions. The resulting configuration objects are passed into :meth:`Action.identifier`, :meth:`Action.discriminators`, :meth:`Action.perform`, and :meth:`Action.before` and :meth:`Action.after`. After commit completes, the configured objects are found as attributes on :class:`App.config`. .. py:attribute:: tag .. py:method:: identifier(homepage_widget_registry: dict[str, RegisteredHomepageWidget]) -> str Returns an immutable that uniquely identifies this config. Needs to be implemented by the :class:`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 :class:`ConflictError` is raised during :func:`commit`. 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. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. :return: an immutable value uniquely identifying this action. .. py:method:: perform(func: collections.abc.Callable[[], HomepageWidget], homepage_widget_registry: dict[str, RegisteredHomepageWidget]) -> None Do whatever configuration is needed for ``obj``. Needs to be implemented by the :class:`Action` subclass. Raise a :exc:`DirectiveError` to indicate that the action cannot be performed due to incorrect configuration. :param obj: the object that the action should be performed for. Typically a function or a class object. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. .. py:class:: ExportAction(id: str, **kwargs: Any) Bases: :py:obj:`dectate.Action` Register an export. .. py:attribute:: config Describe configuration. A dict mapping configuration names to factory functions. The resulting configuration objects are passed into :meth:`Action.identifier`, :meth:`Action.discriminators`, :meth:`Action.perform`, and :meth:`Action.before` and :meth:`Action.after`. After commit completes, the configured objects are found as attributes on :class:`App.config`. .. py:attribute:: id .. py:attribute:: kwargs .. py:method:: identifier(export_registry: dict[str, Any]) -> str Returns an immutable that uniquely identifies this config. Needs to be implemented by the :class:`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 :class:`ConflictError` is raised during :func:`commit`. 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. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. :return: an immutable value uniquely identifying this action. .. py:method:: perform(cls: collections.abc.Callable[Ellipsis, Any], export_registry: dict[str, Any]) -> None Do whatever configuration is needed for ``obj``. Needs to be implemented by the :class:`Action` subclass. Raise a :exc:`DirectiveError` to indicate that the action cannot be performed due to incorrect configuration. :param obj: the object that the action should be performed for. Typically a function or a class object. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. .. py:class:: UserlinkAction Bases: :py:obj:`dectate.Action` Registers a user link group. .. py:attribute:: config Describe configuration. A dict mapping configuration names to factory functions. The resulting configuration objects are passed into :meth:`Action.identifier`, :meth:`Action.discriminators`, :meth:`Action.perform`, and :meth:`Action.before` and :meth:`Action.after`. After commit completes, the configured objects are found as attributes on :class:`App.config`. .. py:attribute:: counter :type: ClassVar .. py:attribute:: name .. py:method:: identifier(linkgroup_registry: list[LinkGroupFactory]) -> int Returns an immutable that uniquely identifies this config. Needs to be implemented by the :class:`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 :class:`ConflictError` is raised during :func:`commit`. 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. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. :return: an immutable value uniquely identifying this action. .. py:method:: perform(func: LinkGroupFactory, linkgroup_registry: list[LinkGroupFactory]) -> None Do whatever configuration is needed for ``obj``. Needs to be implemented by the :class:`Action` subclass. Raise a :exc:`DirectiveError` to indicate that the action cannot be performed due to incorrect configuration. :param obj: the object that the action should be performed for. Typically a function or a class object. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. .. py:class:: DirectorySearchWidgetAction(name: str) Bases: :py:obj:`dectate.Action` Registers a directory search widget. .. py:attribute:: config Describe configuration. A dict mapping configuration names to factory functions. The resulting configuration objects are passed into :meth:`Action.identifier`, :meth:`Action.discriminators`, :meth:`Action.perform`, and :meth:`Action.before` and :meth:`Action.after`. After commit completes, the configured objects are found as attributes on :class:`App.config`. .. py:attribute:: name .. py:method:: identifier(directory_search_widget_registry: DirectorySearchWidgetRegistry) -> str Returns an immutable that uniquely identifies this config. Needs to be implemented by the :class:`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 :class:`ConflictError` is raised during :func:`commit`. 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. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. :return: an immutable value uniquely identifying this action. .. py:method:: perform(cls: type[DirectorySearchWidget[Any]], directory_search_widget_registry: DirectorySearchWidgetRegistry) -> None Do whatever configuration is needed for ``obj``. Needs to be implemented by the :class:`Action` subclass. Raise a :exc:`DirectiveError` to indicate that the action cannot be performed due to incorrect configuration. :param obj: the object that the action should be performed for. Typically a function or a class object. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. .. py:class:: EventSearchWidgetAction(name: str) Bases: :py:obj:`dectate.Action` Registers a text search widget. .. py:attribute:: config Describe configuration. A dict mapping configuration names to factory functions. The resulting configuration objects are passed into :meth:`Action.identifier`, :meth:`Action.discriminators`, :meth:`Action.perform`, and :meth:`Action.before` and :meth:`Action.after`. After commit completes, the configured objects are found as attributes on :class:`App.config`. .. py:attribute:: name .. py:method:: identifier(event_search_widget_registry: EventSearchWidgetRegistry) -> str Returns an immutable that uniquely identifies this config. Needs to be implemented by the :class:`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 :class:`ConflictError` is raised during :func:`commit`. 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. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. :return: an immutable value uniquely identifying this action. .. py:method:: perform(cls: type[EventSearchWidget], event_search_widget_registry: EventSearchWidgetRegistry) -> None Do whatever configuration is needed for ``obj``. Needs to be implemented by the :class:`Action` subclass. Raise a :exc:`DirectiveError` to indicate that the action cannot be performed due to incorrect configuration. :param obj: the object that the action should be performed for. Typically a function or a class object. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. .. py:class:: SettingsView(name: str, title: str, order: int = 0, icon: str = 'fa-cogs') Bases: :py:obj:`dectate.Action` Registers a settings view. .. py:attribute:: config Describe configuration. A dict mapping configuration names to factory functions. The resulting configuration objects are passed into :meth:`Action.identifier`, :meth:`Action.discriminators`, :meth:`Action.perform`, and :meth:`Action.before` and :meth:`Action.after`. After commit completes, the configured objects are found as attributes on :class:`App.config`. .. py:attribute:: name .. py:attribute:: setting :type: SettingsDict .. py:method:: identifier(settings_view_registry: dict[str, SettingsDict]) -> str Returns an immutable that uniquely identifies this config. Needs to be implemented by the :class:`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 :class:`ConflictError` is raised during :func:`commit`. 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. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. :return: an immutable value uniquely identifying this action. .. py:method:: perform(func: Any, settings_view_registry: dict[str, SettingsDict]) -> None Do whatever configuration is needed for ``obj``. Needs to be implemented by the :class:`Action` subclass. Raise a :exc:`DirectiveError` to indicate that the action cannot be performed due to incorrect configuration. :param obj: the object that the action should be performed for. Typically a function or a class object. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. .. py:class:: Boardlet(name: str, order: tuple[int, int], icon: str = '') Bases: :py:obj:`dectate.Action` Registers a boardlet on the Dashboard. .. py:attribute:: config Describe configuration. A dict mapping configuration names to factory functions. The resulting configuration objects are passed into :meth:`Action.identifier`, :meth:`Action.discriminators`, :meth:`Action.perform`, and :meth:`Action.before` and :meth:`Action.after`. After commit completes, the configured objects are found as attributes on :class:`App.config`. .. py:attribute:: name .. py:attribute:: order .. py:attribute:: icon :value: '' .. py:method:: identifier(boardlets_registry: dict[str, BoardletConfig]) -> str Returns an immutable that uniquely identifies this config. Needs to be implemented by the :class:`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 :class:`ConflictError` is raised during :func:`commit`. 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. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute. :return: an immutable value uniquely identifying this action. .. py:method:: perform(func: type[onegov.org.models.Boardlet], boardlets_registry: dict[str, BoardletConfig]) -> None Do whatever configuration is needed for ``obj``. Needs to be implemented by the :class:`Action` subclass. Raise a :exc:`DirectiveError` to indicate that the action cannot be performed due to incorrect configuration. :param obj: the object that the action should be performed for. Typically a function or a class object. :param ``**kw``: a dictionary of configuration objects as specified by the ``config`` class attribute.