circuits.core.manager – Manager

Manager

This module definse the Manager class subclasses by component.BaseComponent

Events

none

Classes

class circuits.core.manager.Manager(*args, **kwargs)

Manager

This is the base Manager of the BaseComponent which manages an Event Queue, a set of Event Handlers, Channels, Tick Functions, Registered and Hidden Components, a Task and the Running State.

Variables:manager – The Manager of this Component or Manager

initializes x; see x.__class__.__doc__ for signature

name

Return the name of this Component/Manager

running

Return the running state of this Component/Manager

state

Return the current state of this Component/Manager

The state can be one of:
  • [R]unning
  • [D]ead
  • [S]topped
addHandler(handler, *channels, **kwargs)

Add a new Event Handler

Add a new Event Handler to the Event Manager.

add(*args, **kwargs)

Deprecated in 1.6

Deprecated since version 1.6: Use addHandler() instead.

removeHandler(handler, channel=None)

Remove an Event Handler

Remove the given Event Handler from the Event Manager removing it from the given channel. if channel is None, remove it from all channels. This will succeed even if the specified handler has already been removed.

remove(*args, **kwargs)

Deprecated in 1.6

Deprecated since version 1.6: Use removeHandler() instead.

fireEvent(event, channel=None, target=None)

Fire/Push a new Event into the system (queue)

This will push the given Event, Channel and Target onto the Event Queue for later processing.

if target is None, then target will be set as the Channel of the current Component, self.channel (defaulting back to None).

If this Component’s Manager is itself, enqueue on this Component’s Event Queue, otherwise enqueue on this Component’s Manager.

Parameters:
  • event (Event) – The Event Object
  • channel (str) – The Channel this Event is bound for

@keyword target: The target Component’s channel this Event is bound for :type target: str or Component

fire(event, channel=None, target=None)

Fire/Push a new Event into the system (queue)

This will push the given Event, Channel and Target onto the Event Queue for later processing.

if target is None, then target will be set as the Channel of the current Component, self.channel (defaulting back to None).

If this Component’s Manager is itself, enqueue on this Component’s Event Queue, otherwise enqueue on this Component’s Manager.

Parameters:
  • event (Event) – The Event Object
  • channel (str) – The Channel this Event is bound for

@keyword target: The target Component’s channel this Event is bound for :type target: str or Component

push(*args, **kwargs)

Deprecated in 1.6

Deprecated since version 1.6: Use fire() instead.

flushEvents()

Flush all Events in the Event Queue

flush()

Flush all Events in the Event Queue

Components

none

Functions

none