stepsequence.core

Attributes

_T

Exceptions

DuplicatedStepError

Common base class for all non-exit exceptions.

Classes

Step

StepCollection

StepSequenceRegistry

Functions

as_step_registry_id(→ str)

Module Contents

stepsequence.core._T[source]
exception stepsequence.core.DuplicatedStepError[source]

Bases: Exception

Common base class for all non-exit exceptions.

stepsequence.core.as_step_registry_id(cls_name: str, position: int, cls_before: str | None = None, cls_after: str | None = None) str[source]
class stepsequence.core.Step(title: int | str, origin: str, position: int, cls_after: str | None = None, cls_before: str | None = None)[source]
__lt__(other: Step) bool[source]

Return self<value.

__gt__(other: Step) bool[source]

Return self>value.

property id: str[source]

Unique ID for a step.

__repr__() str[source]

Return repr(self).

class stepsequence.core.StepCollection[source]
_steps: list[Step][source]
_ids() set[str][source]
add(step: Step) None[source]
keys() set[str][source]
get(position: int | None = None) Step | None[source]
class stepsequence.core.StepSequenceRegistry[source]
registry: dict[str, StepCollection][source]
flattened_registry: dict[str, Step][source]
get(step_id: str | None = None, cls_name: str | None = None, position: int | None = None) Step | None[source]
by_id(step_id: str) list[Step][source]
by_id(step_id: None) None
register(cls_name: str, position: int, title: str | None = None, cls_before: str | None = None, cls_after: str | None = None) Step[source]

Registers a step by its position, and the class names that come before and after.

registered_step(position: int, title: str | None = None, cls_before: str | None = None, cls_after: str | None = None) Callable[[type[_T]], type[_T]][source]

A decorator to register part of a full step sequence as follows:

@step_sequences.registered_step(

1, _(‘Confirm’), cls_after=’FormSubmission’) class MyDBModel(Base, StepsExtension):

pass