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

Class EDApplication

source code

object --+
         |
        EDApplication
Known Subclasses:

This is the main EDNA application class. This class can be sub-classed for any specific application need. An EDNA application is able to launch an entry point plugin. It accepts the following parameter: --execute : name of the plugin to be executed --inputFile : related plugin data (xml input data file name) --outputFile : related plugin result (xml output data file name) --conf : configuration file name --basedir : where the application working directory should go --DEBUG or --debug : turns on debugging -v or --version : Displays the application name and version --verbose : Turns on verbose mode --no-log : Turns off logging -h or --help : Prints out an usage message

Instance Methods [hide private]
 
__init__(self, _strName='EDApplication', _strVersion='1.0.1', _strPluginName=None, _strConfigurationFileName=None, _strDataInputFilePath=None, _edLogFile=None, _strBaseDir=None, _strWorkingDir=None, _strDataOutputFilePath=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
execute(self)
This is the main execute method which executes preProcess, process and postProcess.
source code
 
preProcess(self)
Creates the application working directory (log dir) Initializes the configuration retrieves the plugin xml data to be passed to the plugin
source code
 
process(self)
Calls the Plugin to be executed
source code
 
processCommandline(self)
This method is intended to be overridden by applications who would like to implement their own command line handling.
source code
 
processCommandLineDebugVerboseLogFile(self) source code
 
processCommandLineHelp(self) source code
 
processCommandLineVersion(self) source code
 
processCommandLinePluginName(self) source code
 
processCommandLineInputFilePath(self) source code
 
processCommandLineOutputFilePath(self) source code
 
processCommandLineBaseDirectory(self) source code
 
postProcess(self) source code
 
getDataInputFilePath(self) source code
string
getBaseDir(self)
Getter for base directory
source code
 
createApplicationWorkingDirectory(self)
Created the working directory of the application (<date>-<application name>) First tries to retrieve the base dir from --basedir option or related parameter from constructor Otherwise tries to retrieve it from EDNA_BASE_DIRECTORY environment variable Otherwise put the base dir as the current directory
source code
 
getFullApplicationWorkingDirectory(self) source code
 
getCurrentWorkingDirectory(self) source code
 
doSuccessActionPlugin(self, _edPlugin) source code
 
doFailureActionPlugin(self, _edPlugin) source code
 
getPlugin(self) source code
 
getPluginOutputData(self) source code
 
getWarningMessages(self) source code
 
getErrorMessages(self) source code
 
getEdCommandLine(self) source code
 
getCommandLine(self) source code
 
getCommandLineArguments(self) source code
 
getCommandLineArgument(self, _strKey) source code
 
getApplicationName(self) source code
string @return working dir
getWorkingDir(self)
Getter for working dir
source code
 
setWorkingDir(self, _strDir)
Setter for working dir
source code
 
isFailure(self) source code
 
setFailure(self, _bFailure) source code
 
getPluginName(self) source code

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

Class Methods [hide private]
 
usage(cls)
Print usage...
source code
 
getFactoryPlugin(cls) source code
 
loadPlugin(cls, _strPluginName) source code
 
loadModule(cls, _strModuleName) source code
 
synchronizeOn(cls)
Lock the whole class
source code
 
synchronizeOff(cls)
Unlock the whole class
source code
Class Variables [hide private]
  CONFIGURATION_PARAM_LABEL = '--conf'
  PLUGIN_PARAM_LABEL = '--execute'
  DATASET_PARAM_LABEL = '--inputFile'
  OUTPUT_PARAM_LABEL = '--outputFile'
  DATASET_BASE_DIRECTORY = '--basedir'
  DEBUG_PARAM_LABEL_1 = '--DEBUG'
  DEBUG_PARAM_LABEL_2 = '--debug'
  VERSION_PARAM_LABEL_1 = '-v'
  VERSION_PARAM_LABEL_2 = '--version'
  VERBOSE_MODE_LABEL = '--verbose'
  NO_LOG_LABEL = '--no-log'
  HELP_LABEL_1 = '-h'
  HELP_LABEL_2 = '--help'
  __edConfiguration = None
hash(x)
  __edFactoryPlugin = None
hash(x)
  __semaphore = Semaphore()
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, _strName='EDApplication', _strVersion='1.0.1', _strPluginName=None, _strConfigurationFileName=None, _strDataInputFilePath=None, _edLogFile=None, _strBaseDir=None, _strWorkingDir=None, _strDataOutputFilePath=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

processCommandline(self)

source code 

This method is intended to be overridden by applications who would like to implement their own command line handling.

This default method implements the following workflow:

  • Check for debug, verbose and log file command line options

getBaseDir(self)

source code 

Getter for base directory

Returns: string
path of the base directory

setWorkingDir(self, _strDir)

source code 

Setter for working dir

Parameters:
  • _strDir (string) - working dir