Package elisa :: Package core :: Module component :: Class Component
[hide private]
[frames] | no frames]

Class Component

source code


A Component is a simple object created by Plugins. Each Component has:

Nested Classes [hide private]
  __metaclass__
Instance Methods [hide private]
 
__init__(self)
Lazily set name from class name styled with underscores (class ComponentBar -> name component_bar.
source code
 
initialize(self)
Initialize various variables internal to the Component.
source code
 
clean(self)
Perform some cleanups and save the Component config back to application's config.
source code
 
load_config(self, application_config)
Load the component's configuration.
source code
 
save_config(self, application_config)
Store the Component's config in the Application's config, which can be saved back to a file later on.
source code

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

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

Static Methods [hide private]
 
__classinit__(cls, new_attrs)
Given a class and a new set of attributes (as passed in by __classinit__), create or modify properties based on functions with special names ending in __get, __set, and __del.
source code
Class Variables [hide private]
dict default_config = {}
used when nothing found in Application's config
dict config_doc = {}
documentation for each option of the default configuration.
int id = 0
Component's config id
elisa.core.plugin.Plugin plugin = 'frontend'
Plugin instance of the component
  checked = True
string name = 'component'
Component's name

Inherited from extern.log.log.Loggable: logCategory

Instance Variables [hide private]
string path = 'frontend'
unique string identifying the instance: plugin_name:component_name:instance_id
elisa.extern.configobj.ConfigObj config = 'frontend'
Component's configuration
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Lazily set name from class name styled with underscores (class ComponentBar -> name component_bar. Also set log category based on component name, with a 'comp_' prefix.
Overrides: log.Loggable.__init__

initialize(self)

source code 

Initialize various variables internal to the Component.

This method is called by the plugin_registry after the component's config has been loaded.

Override this method if you need to perform some initializations that would normally go in Component's constructor but can't be done there because they require access to the component's config.
Raises:

clean(self)

source code 
Perform some cleanups and save the Component config back to application's config. This method should be called by the elisa.core.manager.Manager holding the component reference when it stops itself.

load_config(self, application_config)

source code 
Load the component's configuration. If none found, create it using the default config stored in `default_config` Component attribute.
Parameters:

save_config(self, application_config)

source code 
Store the Component's config in the Application's config, which can be saved back to a file later on.
Parameters:

Class Variable Details [hide private]

config_doc

documentation for each option of the default configuration. Keys should be same as the ones in default_config and values should be strings
Type:
dict
Value:
{}