Package conduit :: Module ModuleWrapper :: Class ModuleWrapper
[hide private]

Class ModuleWrapper

source code

A generic wrapper for any dynamically loaded module. Wraps the complexity of a stored conduit.DataProvider.DataProvider behind additional descriptive fields like name and description. Useful for classification and searching for moldules of certain types, etc.

Instance Methods [hide private]
 
__init__(self, klass, initargs, category)
Initializes the ModuleWrapper with an uninstantiated class
source code
 
__str__(self) source code
 
get_dnd_key(self) source code
 
set_dnd_key(self, dndKey) source code
 
get_key(self)
Returns a string in the form of classname:initarg0:initarg1:...
source code
 
get_name(self)
Returns: The dataproviders user readable name
source code
 
set_name(self, name)
Sets the dataproviders user readable name
source code
string
get_UID(self)
Returs a unique identifier for the module and its contained dataprovider.
source code
 
get_input_type(self)
Returns the in_type for the module.
source code
 
get_output_type(self)
Returns the out_type for the module.
source code
 
get_icon(self, size=16)
Returns the icon for the module contained in this wrapper.
source code
 
get_descriptive_icon(self)
The descriptive icon is two icons composited side by side.
source code
 
set_configuration_xml(self, xmltext) source code
 
get_configuration_xml(self) source code
 
configure(self, window) source code
 
instantiate_module(self) source code
 
is_pending(self) source code
Method Details [hide private]

__init__(self, klass, initargs, category)
(Constructor)

source code 
Initializes the ModuleWrapper with an uninstantiated class
Parameters:
  • klass - The klass this wrapper wraps
  • initargs - The arguments used to instantiate klass
  • category - The category

get_key(self)

source code 

Returns a string in the form of classname:initarg0:initarg1:...

I suppose I could have used the builtin __getinitargs__ call used with pickle but requires less implementation detail on the part of the DP

get_name(self)

source code 
Returns:
The dataproviders user readable name

get_input_type(self)

source code 
Returns the in_type for the module. If the module has not yet been initialised then its in_type is derived from its class attributes. If it has been initialised then it can supply its own in_type

get_output_type(self)

source code 
Returns the out_type for the module. See get_input_type()

get_icon(self, size=16)

source code 

Returns the icon for the module contained in this wrapper. In the case of a sink or source this is easy as the module contains the icon.

Wrappers derived from this class (such as the CategoryWrapper) may override this function

get_descriptive_icon(self)

source code 
The descriptive icon is two icons composited side by side. On the left is the dataprovider icon, on the right an arrow indicating its type size of each icon