Module EDPlugin :: Class EDPlugin
[hide private]
[frames] | no frames]

Class EDPlugin

source code

        object --+            
                 |            
 EDObject.EDObject --+        
                     |        
   EDLogging.EDLogging --+    
                         |    
        object --+       |    
                 |       |    
threading._Verbose --+   |    
                     |   |    
      threading.Thread --+    
                         |    
         EDAction.EDAction --+
                             |
                            EDPlugin
Known Subclasses:


This is the EDNA plugin main class
An EDNA plugin class:
    - is a configurable entity
    - has a base name (<date>-<random number>-<base name>)
    - handles input/output data (setter, getter, checker)
    - has warning and error messages
    - has a base and a working directory (both are configurable)
    The working directory is the folder from which the plugin is launched
    and should contain all associated files with the plugin execution (edna xml input/output, 3rd party output files)
    The base directory is the parent directory of the working directory. 
    Example: the working directory of a control plugin is the base directory of the plugins that it invokes,
    i.e. the plugins working directories has the control plugin working directory as parent.
- defines the method that generates an executive summary (user-related output summary) that sub-classes should implement

Instance Methods [hide private]
 
__init__(self)
Initializes plugin related attributes described above
source code
 
preProcess(self, _edObject=None)
Writes xml data input in the working dir (if required) Connects a slot for generating the executive summary after the plugin execution Connects a slot for checking output data to the finally process Initialize the base directory Configures the plugin Checks the input data
source code
 
tellFinished(self, _edObject=None)
Tell EDStatus that the plugin has finished, either in success either in error
source code
 
checkDataOutput(self, _edObject=None)
Checks if output data is available, if not issues a warning and sets an empty XSDataResult as output data Writes xml data output in the working dir (if required)
source code
 
synchronize(self)
This method calls EDAction.synchronize and if a time-out occurs an error message is added to the list of error messages.
source code
 
setConfiguration(*arg, **kw)
decorator that deprecates the use of a function
source code
 
getConfiguration(*arg, **kw)
decorator that deprecates the use of a function
source code
 
getConfig(self)
Gets the Plugin Configuration as a dictionary
source code
 
setConfig(self, _dict, _bLocal=False)
Receives a dictionary (Plugin Configuration) from the application.
source code
 
getStringConfigurationParameterValue(*arg, **kw)
decorator that deprecates the use of a function
source code
 
getDoubleConfigurationParameterValue(*arg, **kw)
decorator that deprecates the use of a function
source code
 
getIntegerConfigurationParameterValue(*arg, **kw)
decorator that deprecates the use of a function
source code
 
configure(self)
Should be overridden by the Final Plugin If needed This method should set its proper members attributes from a Plugin configuration Object
source code
 
execute(self, _edObject=None) source code
 
checkParameters(self)
Should be overridden by the Final Plugin If needed This method should check that the data input are consistent
source code
 
setXSDataInputClass(self, _xsDataInputClass, _strDataInputKey=None)
This method should be called in the constructor of the derived plugins in order to set the XSData type of the input data, e.g.
source code
 
getXSDataInputClass(self, _strDataInputKey=None)
Returns the XSData type of the input data.
source code
 
setDataInput(self, _oDataInput, _strDataInputKey=None)
Sets the plugin input data.
source code
 
hasDataInput(self, _strDataInputKey=None)
Returns True if the plugin has Input Data for a particular key.
source code
 
getDataInput(self, _strDataInputKey=None)
Returns the Plugin Input Data for a particular key.
source code
 
delDataInput(self, _strDataInputKey=None)
Deletes the data input for a particular key.
source code
 
setDataOutput(self, _xsDataOutput, _strDataOutputKey=None)
Sets the plugin output data for a particular key.
source code
 
getDataOutput(self, _strDataOutputKey=None)
Returns the Plugin Output Data
source code
 
hasDataOutput(self, _strDataOutputKey=None)
Returns True if the plugin has the specified Output Data
source code
 
delDataOutput(self, _strDataOutputKey=None)
Deletes the data output for a particular key.
source code
 
exportDataOutput(self, _edPlugin=None)
Deprecated Exports the Plugin Output Data to slot
source code
 
connectExportDataOutput(self, _oMethod)
Deprecated
source code
 
generateExecutiveSummary(self, _edPlugin)
This method, which should be implemented by sub-classes, generates an executive summary (user-related output summary).
source code
 
addErrorMessage(self, _strErrorMessage)
Adds an error message to the error messages list
source code
 
getErrorMessages(self)
Returns the error messages list OBS! This method is deprecated, please use getListOfErrorMessages instead.
source code
 
getListOfErrorMessages(self)
Returns the error messages list
source code
 
addWarningMessage(self, _strWarningMessage)
Adds a warning message to the warning messages list
source code
 
getWarningMessages(self)
Returns the warning messages list OBS! This method is deprecated, please use getListOfWarningMessages instead.
source code
 
getListOfWarningMessages(self)
Returns the warning messages list
source code
 
writeDataInput(self, _edObject=None)
Writes the input data object(s) into a working dir xml file
source code
 
writeDataOutput(self, _edObject=None)
Writes the output data object(s) into a working dir xml file
source code
 
getBaseName(self)
Returns the plugin base name
source code
 
setBaseName(self, _strBaseName)
Sets the plugin base name
source code
 
createBaseName(self)
Generates the plugin base name: (<prefix>-<object ID>)
source code
 
compactPluginName(self, _pluginName)
The prefix is constructed from the plugin name with the following renaming: EDPlugin -> "" EDPluginExec -> "" EDPluginControl -> "Control"
source code
 
setBaseDirectory(self, _strBaseDirectory)
Sets the plugin base directory
source code
 
getBaseDirectory(self)
Returns the plugin base directory
source code
 
setWorkingDirectory(self, _strWorkingDirectory)
Sets the plugin working directory
source code
 
getWorkingDirectory(self)
Returns the plugin base directory
source code
 
checkMandatoryParameters(self, _xsData, _strParamName)
Checks that a mandatory parameter exists in the data If not, an error message is added in the list and the plugin fails
source code
 
checkImportantParameters(self, _xsData, _strParamName)
Checks that a specific parameter exists in the data If not, a warning message is added in the list
source code
 
addExecutiveSummaryLine(self, _strExecutiveSummaryLine)
Add a line to the executive summary string.
source code
 
addExecutiveSummarySeparator(self, _strSeparator=None)
Adds a separator to split the executive summary into different parts Default is a dotted line
source code
 
getListExecutiveSummaryLines(self)
Returns the executive summary (list of text lines)
source code
 
verboseScreenExecutiveSummary(self)
Prints the executive summary on the screen
source code
 
verboseDebug(self, _strMessage) source code
 
getPluginName(self) source code
 
getListOfDataInputKeys(self) source code
 
getListOfDataOutputKeys(self) source code
 
getDefaultInputDataKey(self) source code
 
getDefaultOutputDataKey(self) source code
 
getExecutiveSummarySeparator(self) source code
boolean
isRequiredToHaveConfiguration(self)
If the return value from this method is true, the plugin is required to have a configuration in order to be executed in a plugin execution test case.
source code
 
setRequiredToHaveConfiguration(self, _bValue=True)
Sets or unsets the plugin to be required to have a configuration for execution in a plugin execution test case.
source code
 
setWriteXMLInputOutput(self, _bValue=True)
Sets or unsets the plugin to write XML input and output files.
source code
 
setWriteXMLInput(self, _bValue=True)
Sets or unsets the plugin to write XML input files.
source code
 
setWriteXMLOutput(self, _bValue=True)
Sets or unsets the plugin to write XML output files.
source code
 
setUseWarningInsteadOfError(self, _bValue=True)
Sets or unsets the plugin to use warning messages also for error messages.
source code
 
error(self, _strErrorMessage)
Overloaded from EDLogging.
source code
 
ERROR(self, _strErrorMessage)
Uses the overloaded self.error method above.
source code

Inherited from EDAction.EDAction: abort, addExtraTime, connectFAILURE, connectFinallyProcess, connectPostProcess, connectPreProcess, connectProcess, connectSUCCESS, executeAction, executeActionSynchronous, executeKernel, executeSynchronous, finallyProcess, getDefaultTimeOut, getLogTiming, getSlotFAILURE, getSlotSUCCESS, getTimeOut, hasTimedOut, isEnded, isFailure, isRunning, isStarted, isTimeOut, postProcess, process, run, setFailure, setLogTiming, setTimeOut

Inherited from EDLogging.EDLogging: ASSERT, DEBUG, WARNING, isVerboseDebug, log, screen, setAllLogLevels, setLogFileName, setLogFileOff, setLogLevel, setTestOff, setTestOn, setVerboseDebugOff, setVerboseDebugOn, setVerboseOff, setVerboseOn, unitTest, warning, writeErrorTrace

Inherited from EDObject.EDObject: getClassName, getId, getRunTime, getSemaphoreValue, getTimeEnd, getTimeInit, locked, setTimeEnd, setTimeInit, synchronizeOff, synchronizeOn

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from threading.Thread (private): _reset_internal_locks, _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

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

Class Variables [hide private]
  CONF_BASE_DIR_LABEL = 'baseDirectory'
  CONF_WORKING_DIR_LABEL = 'workingDirectory'
  CONF_TIME_OUT = 'timeOut'
  CONF_WRITE_XML_INPUT_OUTPUT = 'writeXMLInputOutput'
  CONF_WRITE_XML_OUTPUT = 'writeXMLOutput'
  CONF_WRITE_XML_INPUT = 'writeXMLInput'

Inherited from EDLogging.EDLogging (private): _EDObject__iId_class

Properties [hide private]
  configuration
decorator that deprecates the use of a function
  config
Gets the Plugin Configuration as a dictionary
  dataInput
Property for dataInput
  dataOutput
Property for dataOutput

Inherited from EDAction.EDAction: logTiming

Inherited from threading.Thread: daemon, ident, name

Inherited from threading.Thread (private): _block

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initializes plugin related attributes described above

Overrides: object.__init__

preProcess(self, _edObject=None)

source code 

Writes xml data input in the working dir (if required) Connects a slot for generating the executive summary after the plugin execution Connects a slot for checking output data to the finally process Initialize the base directory Configures the plugin Checks the input data

Overrides: EDAction.EDAction.preProcess

synchronize(self)

source code 

This method calls EDAction.synchronize and if a time-out occurs an error message is added to the list of error messages.

Overrides: EDAction.EDAction.synchronize

setConfiguration(*arg, **kw)

source code 

decorator that deprecates the use of a function

Decorators:
  • @deprecated

getConfiguration(*arg, **kw)

source code 

decorator that deprecates the use of a function

Decorators:
  • @deprecated

getStringConfigurationParameterValue(*arg, **kw)

source code 

decorator that deprecates the use of a function

Decorators:
  • @deprecated

getDoubleConfigurationParameterValue(*arg, **kw)

source code 

decorator that deprecates the use of a function

Decorators:
  • @deprecated

getIntegerConfigurationParameterValue(*arg, **kw)

source code 

decorator that deprecates the use of a function

Decorators:
  • @deprecated

execute(self, _edObject=None)

source code 
Overrides: EDAction.EDAction.execute

setXSDataInputClass(self, _xsDataInputClass, _strDataInputKey=None)

source code 

This method should be called in the constructor of the derived plugins in order to set the XSData type of the input data, e.g. XSDataInputXXX

setDataInput(self, _oDataInput, _strDataInputKey=None)

source code 

Sets the plugin input data. _oDataInput could be either an String XML or an XSData object.

The input data is stored in a dictionary with the key _strDataInputKey. If the key is not provided a default key is used.

If not data input class is defined for the key an exception is raised.

If the key is not the default key, the data object is added to a list which might contain already stored object(s).

If _oDataInput is None the list corresponding to a keyword is deleted.

hasDataInput(self, _strDataInputKey=None)

source code 

Returns True if the plugin has Input Data for a particular key. If the key is not provided a default key is used.

getDataInput(self, _strDataInputKey=None)

source code 

Returns the Plugin Input Data for a particular key. If the key is not provided a default key is used.

delDataInput(self, _strDataInputKey=None)

source code 

Deletes the data input for a particular key. If the key is not provided a default key is used.

setDataOutput(self, _xsDataOutput, _strDataOutputKey=None)

source code 

Sets the plugin output data for a particular key. If the key is not provided a default key is used.

If the key is already defined in the dictionary, the corresponding data object is added to a list which contains the already stored object(s).

delDataOutput(self, _strDataOutputKey=None)

source code 

Deletes the data output for a particular key. If the key is not provided a default key is used.

isRequiredToHaveConfiguration(self)

source code 

If the return value from this method is true, the plugin is required to have a configuration in order to be executed in a plugin execution test case.

Returns: boolean
RequiredToHaveConfiguration

setRequiredToHaveConfiguration(self, _bValue=True)

source code 

Sets or unsets the plugin to be required to have a configuration for execution in a plugin execution test case. plugin execution test case.

Parameters:
  • _bValue - RequiredToHaveConfiguration

setWriteXMLInputOutput(self, _bValue=True)

source code 

Sets or unsets the plugin to write XML input and output files.

Parameters:
  • _bValue - WriteDataXMLInputOutput

setWriteXMLInput(self, _bValue=True)

source code 

Sets or unsets the plugin to write XML input files.

Parameters:
  • _bValue - WriteDataXMLInput

setWriteXMLOutput(self, _bValue=True)

source code 

Sets or unsets the plugin to write XML output files.

Parameters:
  • _bValue - WriteDataXMLOutput

setUseWarningInsteadOfError(self, _bValue=True)

source code 

Sets or unsets the plugin to use warning messages also for error messages.

Parameters:
  • _bValue - UseWarningInsteadOfError

error(self, _strErrorMessage)

source code 

Overloaded from EDLogging. If self.__bUseWarningInsteadOfError is True a warning message is issued instead of an error message.

Parameters:
  • _strMessage - The error message to be written to standard output and log file
Overrides: EDLogging.EDLogging.error

ERROR(self, _strErrorMessage)

source code 

Uses the overloaded self.error method above.

Parameters:
  • _strMessage - The error message to be written to standard output and log file
Overrides: EDLogging.EDLogging.ERROR

Property Details [hide private]

configuration

decorator that deprecates the use of a function

Get Method:
getConfiguration(*arg, **kw) - decorator that deprecates the use of a function
Set Method:
setConfiguration(*arg, **kw) - decorator that deprecates the use of a function

config

Gets the Plugin Configuration as a dictionary

Get Method:
getConfig(self) - Gets the Plugin Configuration as a dictionary
Set Method:
setConfig(self, _dict, _bLocal=False) - Receives a dictionary (Plugin Configuration) from the application.

dataInput

Property for dataInput

Get Method:
getDataInput(self, _strDataInputKey=None) - Returns the Plugin Input Data for a particular key.
Set Method:
setDataInput(self, _oDataInput, _strDataInputKey=None) - Sets the plugin input data.
Delete Method:
delDataInput(self, _strDataInputKey=None) - Deletes the data input for a particular key.

dataOutput

Property for dataOutput

Get Method:
getDataOutput(self, _strDataOutputKey=None) - Returns the Plugin Output Data
Set Method:
setDataOutput(self, _xsDataOutput, _strDataOutputKey=None) - Sets the plugin output data for a particular key.
Delete Method:
delDataOutput(self, _strDataOutputKey=None) - Deletes the data output for a particular key.