def __init__ (self): """ Initializes plugin related attributes described above """ EDAction.__init__(self) self.__xsPluginItem = None self.__dictXSDataInputClass = {} self.__dictXSDataInput = {} self.__dictXSDataOutput = {} self.__strDefaultInputDataKey = "defaultInputData" self.__strDefaultOutputDataKey = "defaultOutputData" self.__edSlotExportDataOutput = EDSlot() self.__strBaseDirectory = None self.__strWorkingDirectory = None self.__strBaseName = None self.__listExecutiveSummaryLines = [] self.__strExecutiveSummarySeparator = "-" * 80 self.__listErrorMessages = [] self.__listWarningMessages = [] self.__isRequiredToHaveConfiguration = False self.__bWriteDataXMLInputOutput = True self.__bWriteDataXMLOutput = True self.__bWriteDataXMLInput = True self.__strPluginId = "%s-%08i" % (self.getClassName(), self.getId()) self.strPathDataInput = None self.strPathDataOutput = None
def __init__(self): """ Initializes plugin related attributes described above """ EDAction.__init__(self) self.__xsPluginItem = None self.__dictXSDataInputClass = {} self.__dictXSDataInput = {} self.__dictXSDataOutput = {} self.__strDefaultInputDataKey = "defaultInputData" self.__strDefaultOutputDataKey = "defaultOutputData" self.__edSlotExportDataOutput = EDSlot() self.__strBaseDirectory = None self.__strWorkingDirectory = None self.__strBaseName = None self.__listExecutiveSummaryLines = [] self.__strExecutiveSummarySeparator = "-" * 80 self.__listErrorMessages = [] self.__listWarningMessages = [] self.__isRequiredToHaveConfiguration = False self.__bWriteDataXMLInputOutput = True self.__bWriteDataXMLOutput = True self.__bWriteDataXMLInput = True self.__strPluginId = "%s-%08i" % (self.getClassName(), self.getId()) self.strPathDataInput = None self.strPathDataOutput = None self.__bUseWarningInsteadOfError = False self.__edConfiguration = EDConfigurationStatic()
def synchronize(self): """ This method calls EDAction.synchronize and if a time-out occurs an error message is added to the list of error messages. """ EDAction.synchronize(self) if self.isTimeOut(): strErrorMessage = "Timeout when waiting for %s to terminate." % self.getClassName() self.addErrorMessage(strErrorMessage)
def error(self, _strErrorMessage): """ Overloaded from EDLogging. If self.__bUseWarningInsteadOfError is True a warning message is issued instead of an error message. """ if self.__bUseWarningInsteadOfError: self.warning(_strErrorMessage) else: EDAction.error(self, _strErrorMessage)
def __init__(self, _strCommand): """ Initializes the class: the argument _strCommand should be the complete command line, i.e. path to executable + command line arguments """ EDAction.__init__(self) self.__strCommand = _strCommand self.__strExecutionStatus = None self.__subprocess = None self.__iPID = None
def __init__(self, _iNoThreads=None): """ Initalises the action cluster. The max number of threads to be used can be forced, if omitted the number of processors number of threads @param _iNoThreads: max number of threads to be used @type _iNoThreads: integer """ EDAction.__init__(self) self.__iNoThreads = _iNoThreads self.__semaphoreActionCluster = None self.__lActions = []
def 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) """ EDAction.finallyProcess(self, _edObject) if self.__dictXSDataOutput == {}: strWarningMessage = "Output data for plugin %s not set, using XSDataResult as output" % self.getPluginName() self.WARNING(strWarningMessage) self.addWarningMessage(strWarningMessage) self.setDataOutput(XSDataResult()) if self.__bWriteDataXMLInputOutput: if self.__bWriteDataXMLOutput: self.writeDataOutput()
def 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 """ EDAction.preProcess(self, _edObject) self.DEBUG("EDPlugin.preProcess") self.connectPostProcess(self.exportDataOutput) if self.__bWriteDataXMLInputOutput: if self.__bWriteDataXMLInput: self.connectPreProcess(self.writeDataInput) self.connectPostProcess(self.generateExecutiveSummary) self.connectFinallyProcess(self.checkDataOutput) if (self.__strBaseName is None): self.setBaseName(self.createBaseName()) EDStatus.tellRunning(self.__strPluginId) self.connectFinallyProcess(self.tellFinished) self.checkParameters()
def execute(self, _edObject=None): # Configure the plugin before starting it's thread self.configure() EDAction.execute(self, _edObject)