Package circuits :: Package core :: Class BaseComponent

Class BaseComponent

object --+    
         |    
   Manager --+
             |
            BaseComponent
Known Subclasses:

Base Component

This is the Base of the Component which manages registrations to other components or managers. Every Base Component and thus Component has a unique Channel that is used as a separation of concern for it's registered Event Handlers. By default, this Channels is None (or also known as the Global Channel).

When a Component (Base Component) has a set Channel that is not the Global Channel (None), then any Event Handlers will actually listen on a Channel that is a combination of the Component's Channel prefixed with the Event Handler's Channel. The form becomes:

target:channel

Where:

Instance Methods
 
__init__(self, *args, **kwargs)
initializes x; see x.__class__.__doc__ for signature
 
__repr__(x)
repr(x)
 
register(self, manager)
Register all Event Handlers with the given Manager
 
unregister(self)
Unregister all registered Event Handlers

Inherited from Manager: __add__, __iadd__, __isub__, __len__, __sub__, flush, join, push, run, send, start, stop

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

Static Methods
a new object with type S, a subtype of T
__new__(cls, *args, **kwargs)
TODO Work around for Python bug.
Instance Variables
  channel = '*'
The Component's Channel

Inherited from Manager: manager

Properties

Inherited from Manager: 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__

__new__(cls, *args, **kwargs)
Static Method

 

TODO Work around for Python bug.

Bug: http://bugs.python.org/issue5322

Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__repr__(x)
(Representation operator)

 

repr(x)

Overrides: object.__repr__

register(self, manager)

 

Register all Event Handlers with the given Manager

This will register all Event Handlers of this Component to the given Manager. By default, every Component (Base Component) is registered with itself.

Iif the Component or Manager being registered with is not the current Component, then any Hidden Components in registered to this Component will also be regsitered with the given Manager. A Registered Event will also be sent.

unregister(self)

 

Unregister all registered Event Handlers

This will unregister all registered Event Handlers of this Component from it's registered Component or Manager.

Note: It's possible to unregister a Component from itself!