Signals

This is a collection of signals that can be used in the event loop.

class simpleline.event_loop.signals.ExceptionSignal(source, exception_info=None)

Bases: simpleline.event_loop.AbstractSignal

Emit this signal when exception is raised.

This class must be created inside of exception handler or exception_info must be specified in creation process.

If you register handler for this exception then the Simpleline’s exception handling is disabled!

priority

Priority of this event.

Values less than 0 denote higher priorities. Values greater than 0 denote lower priorities. Events from high priority sources are always processed before events from lower priority sources.

source

Source which emitted this event.

class simpleline.event_loop.signals.InputReadySignal(source, input_handler_source, data, priority=0, success=True)

Bases: simpleline.event_loop.AbstractSignal

Input from user is ready for processing.

priority

Priority of this event.

Values less than 0 denote higher priorities. Values greater than 0 denote lower priorities. Events from high priority sources are always processed before events from lower priority sources.

source

Source which emitted this event.

class simpleline.event_loop.signals.RenderScreenSignal(source, priority=0)

Bases: simpleline.event_loop.AbstractSignal

Render UIScreen to terminal.

priority

Priority of this event.

Values less than 0 denote higher priorities. Values greater than 0 denote lower priorities. Events from high priority sources are always processed before events from lower priority sources.

source

Source which emitted this event.

class simpleline.event_loop.signals.CloseScreenSignal(source, priority=0)

Bases: simpleline.event_loop.AbstractSignal

Close current screen.

priority

Priority of this event.

Values less than 0 denote higher priorities. Values greater than 0 denote lower priorities. Events from high priority sources are always processed before events from lower priority sources.

source

Source which emitted this event.

class simpleline.event_loop.signals.InputReceivedSignal(source, data, priority=0)

Bases: simpleline.event_loop.AbstractSignal

Raw input received.

This signal will be further processed and InputReadySignal should be enqueued soon. Most probably you are looking for InputReadySignal instead.

priority

Priority of this event.

Values less than 0 denote higher priorities. Values greater than 0 denote lower priorities. Events from high priority sources are always processed before events from lower priority sources.

source

Source which emitted this event.

Creating custom signals

New signals can be created by subclassing an existing signal class or AbstractSignal

class simpleline.event_loop.AbstractSignal(source, priority=0)

This class is base class for signals.

priority

Priority of this event.

Values less than 0 denote higher priorities. Values greater than 0 denote lower priorities. Events from high priority sources are always processed before events from lower priority sources.

source

Source which emitted this event.