Package circuits :: Package core :: Class Manager

Class Manager

object --+
         |
        Manager
Known Subclasses:

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.

Instance Methods
 
__init__(self, *args, **kwargs)
initializes x; see x.__class__.__doc__ for signature
 
__repr__(x)
repr(x)
 
__len__(x)
len(x)
 
__add__(x, y)
x+y
 
__iadd__(x, y)
x += y
 
__sub__(x, y)
x-y
 
__isub__(x, y)
x -= y
 
push(self, event, channel=None, target=None)
Push a new Event into the queue
 
flush(self)
Flush all Events in the Event Queue
object
send(self, event, channel=None, target=None, errors=False, log=True)
Send a new Event to Event Handlers for the Target and Channel
 
start(self, sleep=0, log=True, process=False)
 
join(self, timeout=None)
 
stop(self)
 
run(self, sleep=0, mode=None, log=True, _Manager__self=None)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Instance Variables
  manager
The Manager of this Component or Manager
Properties
  name
  running
  state

Inherited from object: __class__

Method Details

__init__(self, *args, **kwargs)
(Constructor)

 

initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

__repr__(x)
(Representation operator)

 

repr(x)

Overrides: object.__repr__

__len__(x)
(Length operator)

 

len(x)

Returns the number of events in the Event Queue.

__add__(x, y)
(Addition operator)

 

x+y

(Optional) Convenience operator to register y with x Equivalent to: y.register(x)

Returns:
x @rtype Component or Manager

__iadd__(x, y)

 

x += y

(Optional) Convenience operator to register y with x Equivalent to: y.register(x)

Returns:
x @rtype Component or Manager

__sub__(x, y)
(Subtraction operator)

 

x-y

(Optional) Convenience operator to unregister y from x.manager Equivalent to: y.unregister()

Returns:
x @rtype Component or Manager

__isub__(x, y)

 

x -= y

(Optional) Convenience operator to unregister y from x Equivalent to: y.unregister()

Returns:
x @rtype Component or Manager

push(self, event, channel=None, target=None)

 

Push a new Event into the 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
  • target (str or Component) - The target Component's channel this Event is bound for

flush(self)

 

Flush all Events in the Event Queue

This will flush all Events in the Event Queue. If this Component's Manager is itself, flush all Events from this Component's Event Queue, otherwise, flush all Events from this Component's Manager's Event Queue.

send(self, event, channel=None, target=None, errors=False, log=True)

 

Send a new Event to Event Handlers for the Target and Channel

This will send the given Event, to the spcified CHannel on the Target Component's Channel.

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
  • target (str or Component) - The target Component's channel this Event is bound for
  • errors (bool) - True to raise errors, False otherwise
  • log (bool) - True to log errors, False otherwise
Returns: object
The return value of the last executed Event Handler

Property Details

name

Get Method:
unreachable.name(self)

running

Get Method:
unreachable.running(self)

state

Get Method:
unreachable.state(self)