ravestate.module
Module
Module(self, *, name: str, config: Dict[str, Any] = None, depends: Iterable[ForwardRef('Module')] = None)
Atomic class, which encapsulates a named set of states, properties and config entries, which form a coherent bundle.
Example:
with Module(name="my_module", config={"paramA": 42}): # define properties # define states
modules_per_python_module
defaultdict(default_factory[, ...]) --> dict with default factory
The default factory is called without arguments to produce a new value when a key is not present, in getitem only. A defaultdict compares equal to a dict with the same items. All remaining arguments are treated the same as if they were passed to the dict constructor, including keyword arguments.
registered_modules
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
has_module
has_module(module_name: str) -> bool
Check whether a module with a particular name has been registered.
module_name
: The name which should be checked for beign registered.
Returns: True if a module with the given name has been registered, false otherwise.
get_module
get_module(module_name: str) -> Set[ravestate.module.Module]
Get modules registered with a particular name.
Note: If the module_name refers to a Python module, multiple Ravestate modules might be returned.
module_name
: Python or Ravestate module name.
Returns: The modules registered under the given name, empty set otherwise.