We currently don't have an example that uses a state
space to build a machine, so in order to make people aware
of this ability add an example that uses it to build a simple
state machine.
Change-Id: Ieec71ceee14f2bb451a52457d1a05aa54898597c
Without explicitly mentioning that it should have its docs
generated sphinx won't generate docs for it, so ensure that
we list __iter__ and __contains__ so that it does get
generated docs.
Also fixes 'default_start_state' docs which were not showing
up since they were on the setter method vs the getter method.
Change-Id: I83d02a3604678d16b16f6da5384ff10543af850f
This ensures that sphinx doc tests are ran and validated
and also runs doc8 to ensure style checks are done and adjusts
some of the current examples and code to fix found issues.
Also fixes the `get_callback_name` method which needs to check
if the __module__ is non-none (since it appears sphinx somehow
triggers it being none).
Change-Id: I54daecff219a9e9be71ff382d36fc2d5e67360cf
For hierarchical machines it seems like it would be
quite useful to allow nested machines to initialize to
states that are not just none so to enable this allow for
providing a callback that will be used to determine the
callback for all nested machines (and nested-nested
machines) so that they can be initialized to the users
desire.
Change-Id: I45a0c0e0c2a976e0df094e6c728f943766be7c7a
To make it easier for users of this library to
differentiate general exceptions from automaton
exceptions it is quite common to have a root exception
class that libraries use (and derive there exceptions
from); this adds that.
Change-Id: I140cb188f58849ac5caea97ed5a422375b549f6f
Both ironic and taskflow share this same code to convert
their state machines into a pydot graph which then gets
converted into SVG to form:
- http://docs.openstack.org/developer/taskflow/states.html
- http://docs.openstack.org/developer/ironic/dev/states.html
So instead of duplicating it, provide a useful helper function
that both (and others) can share to produce a dot/graphviz pretty
diagram from a state machine.
Change-Id: I218740910163a1ca2587d706edc55852af1c0c74
When using a state machine it is not always desired
to use the runner concept, so to ensure both concepts
are modular split runners off into there own module.
Change-Id: Iac8ce50b0a17468190f3f737663b5b094c324a55