Package PyFoam :: Package Basics :: Module FoamOptionParser :: Class FoamOptionParser
[hide private]
[frames] | no frames]

Class FoamOptionParser

source code

optparse.OptionContainer --+    
                           |    
       optparse.OptionParser --+
                               |
                              FoamOptionParser

Wrapper to the usual OptionParser to honor the conventions of OpenFOAM-utilities

Options that are not used by the script are passed to the OpenFOAM-application

Instance Methods [hide private]
  __init__(self, usage=None, version=None, description=None, interspersed=False)
  parse(self, nr=3)
parse the options
  getArgs(self)
Return the arguments left after parsing
  getOptions(self)
Return the options

Inherited from optparse.OptionParser: add_option_group, check_values, disable_interspersed_args, enable_interspersed_args, error, format_help, format_option_help, get_default_values, get_option_group, get_usage, get_version, parse_args, print_help, print_usage, print_version, set_default, set_defaults, set_usage

Inherited from optparse.OptionParser (private): _create_option_list, _get_args, _get_prog_name, _init_parsing_state, _match_long_opt, _populate_option_list, _process_args, _process_long_opt, _process_short_opts

Inherited from optparse.OptionContainer: add_option, add_options, format_description, get_option, has_option, remove_option, set_conflict_handler, set_description

Inherited from optparse.OptionContainer (private): _check_conflict, _create_option_mappings, _share_option_mappings


Class Variables [hide private]

Inherited from optparse.OptionParser: standard_option_list


Method Details [hide private]

__init__(self, usage=None, version=None, description=None, interspersed=False)
(Constructor)

source code 
Parameters:
  • usage - usage string. If missing a default is used
  • version - if missing the PyFoam-version is used
  • description - description of the utility
  • interspersed - needs to be false if options should be passed to an OpenFOAM-utility
Overrides: optparse.OptionParser.__init__

parse(self, nr=3)

source code 
parse the options
Parameters:
  • nr - minimum number of arguments that are to be passed to the application

getArgs(self)

source code 
Return the arguments left after parsing

getOptions(self)

source code 
Return the options