r0b0.utils package

Submodules

r0b0.utils.loaders module

r0b0.utils.loaders.decode_msg(func)[source]

Decorator to decode a message with pickle. Loads the message into its original Message class. The data[‘msg’] value will probably be a hex-encoded string. The Message type should be installed in the environment.

Parameters:

func – The handler function (usually a Gadget function)

r0b0.utils.loaders.encode_msg(func)[source]

Decorator to encode a message with pickle to send non-serializable objects through sockets as strings.

Parameters:

func – A function that emits an event through a socket

r0b0.utils.loaders.load_config(config_name: str, config_type: str) dict[source]

Load a configuration from a yaml file in the config directory.

Arguments:

config_name: The name of the configuration to load config_type: The

r0b0.utils.loaders.load_gadget(config_name: str, *, config_type: str = 'gadgets') dict

Load a configuration from a yaml file in the config directory.

Arguments:

config_name: The name of the configuration to load config_type: The

r0b0.utils.loaders.load_rig(config_name: str, *, config_type: str = 'rigs') dict

Decorators for dumping and loading pickles

r0b0.utils.loaders.load_yaml(yaml_file: str, **kwargs)[source]

Load a yaml as a dictionary

Arguments:

yaml_file: The path to the yaml file

Returns:

yaml_dict: The dictionary loaded from the yaml

Raises:

Module contents