OSFI-Python  3.10.0
OpenSF Integration Library
OSFI.CLP.CLP Class Reference

Public Member Functions

def __init__ (self, argv=None)
 
def getConfFile (self)
 
def getConfFiles (self)
 
def getInputFiles (self)
 
def getOutputFiles (self)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __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().

Member Function Documentation

◆ 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: