OSFI-Python
3.9.2
OpenSF Integration Library
|
CLP class provide routines to parse the command line arguments, generating
a list of tokens grouped as:
- Configuration file
- Input files
- Output files
Command line must follow the following format (expressed in Extended Backus-Naur form):
- CLIv1:
<command_line> ::= <executable_name> <whitespaces> <configuration_files> <whitespaces>
<input_files> <whitespaces> <output_files> <EOL>
<executable_name> ::= <file_name>
<whitespace> ::= (“ “)
<whitespaces> ::= <whitespace>+
<file_name> ::= (<alphanumeric>)+
<configuration_files> ::= <list_of_files>
<input_files> ::= <list_of_files>
<output_files> ::= <list_of_files>
<list_of_files> ::= <file_name> (“,” <file_name>)*
- CLIv2:
<command_line> ::= <executable> <options>
<options> ::= (<global_config> | <local_config> | <input_file> | <output_file>)*
<executable>> ::= <file_name>
<global_config> ::= (--global|-g) <file_name>
<local_config> ::= (--local|-l) <file_name>
<input_file> ::= (--input|-i) <file_name>
<output_file> ::= (--output|-o) <file_name>
<file_name> ::= (<alphanumeric>)+
File names must be valid OS-dependant file locations. Per the E2E-ICD, the configuration, input
and output file names can be either a full-path name or a relative path name. Relative paths
are interpreted by the module as relative to the current working directory. In particular, no
reference to the possible E2E_HOME variable is made.
◆ __init__()
def OSFI.CLP.CLP.__init__ |
( |
|
self, |
|
|
|
argv = None |
|
) |
| |
Constructor, may be given the command line to parse or take it from sys.argv.
Note that the command line is expected to have a first element (argv[0]) representing the
application name, and it is dropped while parsing. Thus, a list of length 3 or 4 is needed,
where the last element (argv[3], representing the output files) is optional.
References OSFI.CLP.CLP.__checkValidFile(), OSFI.CLP.CLP.__confFile, OSFI.CLP.CLP.__confFiles, OSFI.CLP.CLP.__inputFiles, OSFI.CLP.CLP.__outputFiles, OSFI.CLP.CLP.__parseArgsV2(), OSFI.CLP.CLP.__parseFilesV1(), and OSFI.CLP.CLP.__raiseErrorMixingOptions().
◆ getConfFile()
def OSFI.CLP.CLP.getConfFile |
( |
|
self | ) |
|
Gets the name of the configuration file.
Configuration file can be "" is no configuration file is passed.
References OSFI.CLP.CLP.__confFile.
◆ getConfFiles()
def OSFI.CLP.CLP.getConfFiles |
( |
|
self | ) |
|
Gets a copy of the list of the configuration files.
This list will always have two elements, with the first one representing the global
configuration file and the second one the local configuration file. If any of them is not
given in the command line, the corresponding slot will be None.
References OSFI.CLP.CLP.__confFiles.
◆ getInputFiles()
def OSFI.CLP.CLP.getInputFiles |
( |
|
self | ) |
|
Gets a copy of the list of the input files.
References OSFI.CLP.CLP.__inputFiles.
◆ getOutputFiles()
def OSFI.CLP.CLP.getOutputFiles |
( |
|
self | ) |
|
Gets a copy of the list of the output files.
References OSFI.CLP.CLP.__outputFiles.
The documentation for this class was generated from the following file:
- include/Python/OSFI/CLP.py
__name
Definition: ParamType.py:36
def getNdims(self)
Definition: Parameter.py:382
__paramComplexType
Definition: Parameter.py:50
__max
Definition: Parameter.py:54
def getDoubleValue(self)
Definition: Parameter.py:128
__outputFiles
Definition: CLP.py:77
hour
Definition: TimeValue.py:52
def validateAgainst(self, xsdFile)
Definition: ParamReader.py:245
__confFile
Definition: CLP.py:74
minute
Definition: TimeValue.py:53
def __readArray(self, curElem, curPath)
Definition: ParamParserComplex.py:87
__param
Definition: ParamParserComplex.py:24
Definition: ParamReader.py:29
def external_var(self, key)
Definition: OsfiEnv.py:26
def getUnits(self)
Definition: Parameter.py:422
__isStringBased
Definition: ParamType.py:38
def getParameters(self, groupName)
Definition: ParamReader.py:100
def __init__(self, xmlFile)
Definition: UsageReader.py:23
def getAllParameters(self)
Definition: ParamReader.py:113
def parse(s)
Definition: TimeValue.py:103
def getFileFormattedValue(fileName)
Definition: Parameter.py:365
__units
Definition: Parameter.py:52
def getIntValue(self)
Definition: Parameter.py:120
value
Definition: ParamParserComplex.py:30
def __raiseErrorMixingOptions(self)
Definition: CLP.py:143
def splitValues(self, string, expected_empty=False)
Definition: ParamType.py:63
def validateAgainstInternalSchema(self)
Definition: ParamReader.py:254
_values
Definition: OsfiEnv.py:24
def getVectorDouble(self)
Definition: Parameter.py:200
__root
Definition: ParamReader.py:86
def getVectorFile(self)
Definition: Parameter.py:193
def getArrayValue(self, *indices, **kwargs)
Definition: Parameter.py:303
def __format__(self, fmt)
Definition: TimeValue.py:57
def __init__(self, argv=None)
Definition: CLP.py:65
def parseMultipleValues(self, value, expectedLen=None)
Definition: ParamType.py:46
Definition: ParamParserComplex.py:17
def __readParameter(self, currentElement, aType, aComplexType, pValue, completeName)
Definition: ParamReader.py:201
def __parseFilesV1(self, argv)
Definition: CLP.py:153
def getConfFiles(self)
Definition: CLP.py:187
def getVectorTime(self)
Definition: Parameter.py:214
def __eq__(self, value)
Definition: TimeValue.py:84
def __setitem__(self, key, value)
Definition: OsfiEnv.py:40
Definition: Parameter.py:527
__tree
Definition: ParamReader.py:85
def getMatrixBoolean(self)
Definition: Parameter.py:278
dom
Definition: TimeValue.py:50
nanosec
Definition: TimeValue.py:55
def getName(self)
Definition: Parameter.py:397
def cleanString(self, string)
Definition: Parameter.py:476
Definition: UsageReader.py:16
__name
Definition: Parameter.py:46
type
Definition: ParamParserComplex.py:27
def getType(self)
Definition: Parameter.py:452
__min
Definition: Parameter.py:53
def __doValidate(self, xsdPathOrUrl)
Definition: ParamReader.py:226
__parseSingleVal
Definition: ParamType.py:37
Definition: Parameter.py:20
__inputFiles
Definition: CLP.py:76
def getVectorInt(self)
Definition: Parameter.py:207
def getMatrixTime(self)
Definition: Parameter.py:294
typing.List[typing.List[bool]] fileExists(self)
Definition: Parameter.py:335
def __init__(self, name, description, elType, value, aDims=(), aUnits='', aMin='', aMax='', aParamComplexType='NONE')
Definition: Parameter.py:33
Definition: TimeValue.py:38
def __astuple(self)
Definition: TimeValue.py:77
def splitValues(self, string)
Definition: Parameter.py:483
def getTimeValue(self)
Definition: Parameter.py:159
def __parseValAsMatrix(self, paramType)
Definition: Parameter.py:222
def getPath(self)
Definition: Parameter.py:410
def setParameter(self, paramName, value)
Definition: ParamReader.py:127
def geMax(self)
Definition: Parameter.py:438
def __readMatrix(self)
Definition: ParamParserComplex.py:54
def __parseArgsV2(self, argv)
Definition: CLP.py:116
def getMatrixFile(self)
Definition: Parameter.py:286
def getBooleanValue(self)
Definition: Parameter.py:136
Definition: Parameter.py:506
def __parseValAsScalar(self, paramType)
Definition: Parameter.py:114
def getConfFile(self)
Definition: CLP.py:179
def __getitem__(self, key)
Definition: OsfiEnv.py:37
def __init__(self, xmlFile, xsdFile=None)
Definition: ParamReader.py:63
def __parseValAsVector(self, paramType)
Definition: Parameter.py:168
_base_cfg
Definition: OsfiEnv.py:23
def getDims(self)
Definition: Parameter.py:390
__ctype
Definition: ParamParserComplex.py:26
def getMax(self)
Definition: Parameter.py:444
def __checkValidFile(self, fileName)
Definition: CLP.py:167
def __traverseNodes(self, parentPath, element)
Definition: ParamReader.py:145
def getInputFiles(self)
Definition: CLP.py:196
def getOutputFiles(self)
Definition: CLP.py:202
year
Definition: TimeValue.py:48
__description
Definition: Parameter.py:47
children
Definition: Parameter.py:538
__value
Definition: Parameter.py:51
Definition: OsfiEnv.py:15
def getVectorString(self)
Definition: Parameter.py:186
elems
Definition: Parameter.py:537
def existParameter(self, paramName)
Definition: ParamReader.py:119
__confFiles
Definition: CLP.py:75
def FileExists(filename)
Definition: Parameter.py:494
Definition: ParamReader.py:35
def getValue(self, asType=None)
Definition: Parameter.py:87
def write(self)
Definition: Parameter.py:63
def getRawValue(self)
Definition: Parameter.py:81
Definition: ParamType.py:22
def setValue(self, aValue)
Definition: Parameter.py:375
sec
Definition: TimeValue.py:54
def getVectorBoolean(self)
Definition: Parameter.py:179
def getLocalName(self)
Definition: Parameter.py:406
__fqName
Definition: ParamParserComplex.py:25
def getMatrixInt(self)
Definition: Parameter.py:262
def __determineConsistentType(self)
Definition: ParamParserComplex.py:40
def getParamType(self)
Definition: Parameter.py:459
def parseAs(self, paramType, indices=())
Definition: Parameter.py:545
def write(self)
Definition: ParamReader.py:137
month
Definition: TimeValue.py:49
__dims
Definition: Parameter.py:55
__type
Definition: Parameter.py:49
def __parseSingleValAs(self, paramType, value)
Definition: Parameter.py:103
def getMatrixString(self)
Definition: Parameter.py:270
def getFileValue(self)
Definition: Parameter.py:151
def getMatrixDouble(self)
Definition: Parameter.py:254
def getParamComplexType(self)
Definition: Parameter.py:470
def getDescription(self)
Definition: Parameter.py:414
def getParameter(self, paramName)
Definition: ParamReader.py:92
def getStringValue(self)
Definition: Parameter.py:144
__usage
Definition: UsageReader.py:29
def getMin(self)
Definition: Parameter.py:430
def getUsage(self)
Definition: UsageReader.py:36
def __lt__(self, value)
Definition: TimeValue.py:93
def getElementType(self)
Definition: Parameter.py:462