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

Class EDPluginExecProcessScript

source code

         object --+                        
                  |                        
  EDObject.EDObject --+                    
                      |                    
    EDLogging.EDLogging --+                
                          |                
         object --+       |                
                  |       |                
 threading._Verbose --+   |                
                      |   |                
       threading.Thread --+                
                          |                
          EDAction.EDAction --+            
                              |            
              EDPlugin.EDPlugin --+        
                                  |        
          EDPluginExec.EDPluginExec --+    
                                      |    
EDPluginExecProcess.EDPluginExecProcess --+
                                          |
                                         EDPluginExecProcessScript

The super class for all EDNA plugins that execute a task using a script. This class manages the process script to be executed:

Instance Methods [hide private]
 
__init__(self)
Initializes process related attributes described above
source code
 
preProcess(self, _edObject=None)
Calls the parent preProcess method Generates the script
source code
 
generateScript(self, _edObject=None)
This method prepares the script and writes it to disk.
source code
 
process(self, _edObject=None)
This method starts the execution of the EDNA script using EDActionExecuteSystemCommand In case of failure, an error message is added to the list and the plugin fails.
source code
 
postProcess(self, _edObject=None)
Calls the parent preProcess method Checks that the installed 3rd party software is in the list of compatible versions
source code
 
configure(self)
Configures the plugin from the configuration file with the following parameters
source code
 
prepareScript(self)
Returns a string containing the script.
source code
 
prepareShellScript(self)
Returns a string containing the Shell script.
source code
 
preparePythonScript(self)
Returns a string containing the Python script.
source code
 
prepareBatchScript(self)
Returns a string containing the windows batch script.
source code
 
getListOfCompatibleVersions(self)
Returns the list of compatible executable versions the plugin supports
source code
 
addCompatibleVersion(self, _strCompatibleVersion)
Adds a compatible executable version to the list
source code
 
getCompatibleVersionsStringLine(self)
This Method constructs a string line by concatening the compatible versions this plugin supports This is for Log message purpose only.
source code
 
setRequireCCP4(self, _bReqireCCP4)
Sets a requirement on CCP4
source code
 
getRequireCCP4(self)
Returns True if the executable requires CCP4
source code
 
setListCommandExecution(self, _listCommandExecution)
Sets the list of execution commands
source code
 
addListCommandExecution(self, _strCommandExecution)
Adds an execution command to the list
source code
 
getListCommandExecution(self)
Returns the list of execution commands
source code
 
setListCommandPreExecution(self, _listCommandPreExecution)
Sets the list of pre execution commands
source code
 
addListCommandPreExecution(self, _strCommandPreExecution)
Adds a pre execution command to the list
source code
 
getListCommandPreExecution(self)
Returns the list of pre execution commands
source code
 
setListCommandPostExecution(self, _listCommandPostExecution)
Sets the list of post execution commands
source code
 
addListCommandPostExecution(self, _strCommandPostExecution)
Adds a post execution command to the list
source code
 
getListCommandPostExecution(self)
Returns the list of post execution commands
source code
 
setScriptShell(self, _strScriptShell)
Sets the script shell
source code
 
getScriptShell(self)
Returns the script shell
source code
 
setScriptExecutor(self, _strScriptExecutor)
Sets the script executor
source code
 
getScriptExecutor(self)
Returns the script executor
source code
 
setSetupCCP4(self, _strSetupCCP4)
Sets the path to CCP4 setup file
source code
 
getSetupCCP4(self)
Returns the path to CCP4 setup file
source code
 
setScriptBaseName(self, _strScriptBaseName)
Sets the script name
source code
 
getScriptBaseName(self)
Returns the script name if None, create it: <date>-<random number>-<base name>
source code
 
setScriptLogFileName(self, _strScriptLogFileName)
Sets the standard output log file name
source code
 
setScriptErrorLogFileName(self, _strScriptErrorLogFileName)
Sets the error output log file name
source code
 
getScriptLogFileName(self)
Returns the standard output log file name
source code
 
getScriptErrorLogFileName(self)
Returns the error output log file name
source code
 
setScriptFileName(self, _strScriptFileName)
Sets the script file name
source code
 
getScriptFileName(self)
Returns the script file name
source code
 
getScriptFilePath(self)
Returns the script file path
source code
 
setScriptExecutable(self, _strScriptExecutable)
Sets the executable path
source code
 
getScriptExecutable(self)
Returns the executable path
source code
 
setScriptCommandline(self, _strScriptCommandline)
Sets the script command line (parameters to executable)
source code
 
getScriptCommandline(self)
Returns the script command line (parameters to executable)
source code
 
setStringVersion(self, _strVersion)
Sets the executable version
source code
 
getStringVersion(self)
Returns the executable version
source code
 
setPathToHostNamePidFile(self, _strPathToHostNamePidFile)
Sets the executable version
source code
 
getPathToHostNamePidFile(self)
Returns the executable version
source code
 
writeExecutableScript(self, _strScript)
Writes the script to the script file.
source code
 
findStringInLog(self, _strInput)
Returns True if a string exists in the log file
source code
 
testVersion(self)
Deprecated not used See postProcess for version checking
source code
 
writeProcessFile(self, _strFileName, _strContent)
Main method to write a file in the plugin working directory Such a file is called process file
source code
 
readProcessFile(self, _strFileName)
Returns the file content of a process file
source code
 
readProcessLogFile(self)
Returns the content of the process standard output log file
source code
 
readProcessErrorLogFile(self)
Returns the content of the process error output log file
source code

Inherited from EDPluginExecProcess.EDPluginExecProcess: getCommandline, getExecutable, getExecutionStatus, getPid, kill, poll_oar, process_locally, process_on_oar, setCommandline, setExecutable

Inherited from EDPluginExec.EDPluginExec: finallyProcess

Inherited from EDPlugin.EDPlugin: ERROR, addErrorMessage, addExecutiveSummaryLine, addExecutiveSummarySeparator, addWarningMessage, checkDataOutput, checkImportantParameters, checkMandatoryParameters, checkParameters, compactPluginName, connectExportDataOutput, createBaseName, delDataInput, delDataOutput, error, execute, exportDataOutput, generateExecutiveSummary, getBaseDirectory, getBaseName, getConfig, getConfiguration, getDataInput, getDataOutput, getDefaultInputDataKey, getDefaultOutputDataKey, getDoubleConfigurationParameterValue, getErrorMessages, getExecutiveSummarySeparator, getIntegerConfigurationParameterValue, getListExecutiveSummaryLines, getListOfDataInputKeys, getListOfDataOutputKeys, getListOfErrorMessages, getListOfWarningMessages, getPluginName, getStringConfigurationParameterValue, getWarningMessages, getWorkingDirectory, getXSDataInputClass, hasDataInput, hasDataOutput, isRequiredToHaveConfiguration, setBaseDirectory, setBaseName, setConfig, setConfiguration, setDataInput, setDataOutput, setRequiredToHaveConfiguration, setUseWarningInsteadOfError, setWorkingDirectory, setWriteXMLInput, setWriteXMLInputOutput, setWriteXMLOutput, setXSDataInputClass, synchronize, tellFinished, verboseDebug, verboseScreenExecutiveSummary, writeDataInput, writeDataOutput

Inherited from EDAction.EDAction: abort, addExtraTime, connectFAILURE, connectFinallyProcess, connectPostProcess, connectPreProcess, connectProcess, connectSUCCESS, executeAction, executeActionSynchronous, executeKernel, executeSynchronous, getDefaultTimeOut, getLogTiming, getSlotFAILURE, getSlotSUCCESS, getTimeOut, hasTimedOut, isEnded, isFailure, isRunning, isStarted, isTimeOut, 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_EXEC_PROCESS_SCRIPT_SHELL = 'execProcessScriptShell'
  CONF_EXEC_PROCESS_SCRIPT_EXECUTOR = 'execProcessScriptExecutor'
  CONF_EXEC_PROCESS_SCRIPT_EXECUTABLE = 'execProcessScriptExecut...
  CONF_EXEC_PROCESS_SCRIPT_SETUP_CCP4 = 'execProcessScriptSetupC...
  CONF_EXEC_PROCESS_SCRIPT_VERSION_STRING = 'execProcessScriptVe...
  START_OF_ENVIRONMENT = 'EDNA_START_OF_ENVIRONMENT'

Inherited from EDPluginExecProcess.EDPluginExecProcess: CONF_EXEC_PROCESS_EXECUTABLE, CONF_EXEC_PROCESS_TIME_OUT

Inherited from EDPlugin.EDPlugin: CONF_BASE_DIR_LABEL, CONF_TIME_OUT, CONF_WORKING_DIR_LABEL, CONF_WRITE_XML_INPUT, CONF_WRITE_XML_INPUT_OUTPUT, CONF_WRITE_XML_OUTPUT

Inherited from EDLogging.EDLogging (private): _EDObject__iId_class

Properties [hide private]
  scriptExecutable
Returns the executable path

Inherited from EDPlugin.EDPlugin: config, configuration, dataInput, 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 process related attributes described above

Overrides: object.__init__

preProcess(self, _edObject=None)

source code 

Calls the parent preProcess method Generates the script

Overrides: EDAction.EDAction.preProcess

process(self, _edObject=None)

source code 

This method starts the execution of the EDNA script using EDActionExecuteSystemCommand In case of failure, an error message is added to the list and the plugin fails.

Overrides: EDAction.EDAction.process

postProcess(self, _edObject=None)

source code 

Calls the parent preProcess method Checks that the installed 3rd party software is in the list of compatible versions

Overrides: EDAction.EDAction.postProcess

configure(self)

source code 

Configures the plugin from the configuration file with the following parameters

  • The shell that will execute the script
  • Script executor
  • Script executable to be invoked
  • Path to CCP4 setup file if required
  • The 3rd party executable installed version
Overrides: EDPlugin.EDPlugin.configure

Class Variable Details [hide private]

CONF_EXEC_PROCESS_SCRIPT_EXECUTABLE

Value:
'execProcessScriptExecutable'

CONF_EXEC_PROCESS_SCRIPT_SETUP_CCP4

Value:
'execProcessScriptSetupCCP4'

CONF_EXEC_PROCESS_SCRIPT_VERSION_STRING

Value:
'execProcessScriptVersionString'

Property Details [hide private]

scriptExecutable

Returns the executable path

Get Method:
getScriptExecutable(self) - Returns the executable path
Set Method:
setScriptExecutable(self, _strScriptExecutable) - Sets the executable path