gabrieltool.statemachine.callable_zoo package

Submodules

gabrieltool.statemachine.callable_zoo.base module

Base class and helper functions for callable classes.

class CallableBase[source]

Bases: object

Base class for Callables used in FSMs.

Custom callable classes need to inherit from this class. Inherited classes should add decorator @record_kwargs to their constructors for serialization.

classmethod from_json(json_obj)[source]

Create a CallableBase class instance from a json object.

Subclasses should overide this class depending on the input type of their constructor.

class Null[source]

Bases: gabrieltool.statemachine.callable_zoo.base.CallableBase

A empty callable class that returns None.

Useful for initialization.

classmethod from_json(json_obj)

Create a CallableBase class instance from a json object.

Subclasses should overide this class depending on the input type of their constructor.

record_kwargs(func)[source]

Decorator to automatically record constructor arguments

>>> class process:
...     @record_kwargs
...     def __init__(self, cmd, reachable=False, user='root'):
...         pass
>>> p = process('halt', True)
>>> p.cmd, p.reachable, p.user
('halt', True, 'root')

Module contents

A collection of Callable classes to be used by Processors and TransitionPredicates.