SimpleSignal

class bapsf_motion.utils.SimpleSignal

Bases: object

A very simple, rudimentary class for creating signals.

Attributes Summary

handlers

List of callbacks/handlers connect to the signal.

is_blocking

True if the signal is currently blocked.

Methods Summary

connect(func)

Connect the callback/handler func to the signal.

disconnect([func])

Disconnect the callback/handler func from the signal.

disconnect_all()

Disconnect all callbacks/handlers for the signal.

emit()

Emit the signal, which executes all the connected handlers.

set_blocking(block)

Set the signal to be blocked True or not False.

Attributes Documentation

handlers

List of callbacks/handlers connect to the signal.

is_blocking

True if the signal is currently blocked. That is, no handlers will be executed on an emit.

Methods Documentation

connect(func: Callable)

Connect the callback/handler func to the signal. The callback should take no arguments.

disconnect(func=None)

Disconnect the callback/handler func from the signal.

disconnect_all()

Disconnect all callbacks/handlers for the signal.

emit()

Emit the signal, which executes all the connected handlers.

set_blocking(block: bool)

Set the signal to be blocked True or not False.