Package svnmailer :: Module cli :: Class OptionParser
[show private | hide private]
[frames | no frames]

Class OptionParser

OptionContainer --+    
                  |    
       OptionParser --+
                      |
                     OptionParser


Fully initialized option parser
Method Summary
  __init__(self, background)
Initialization
str _get_prog_name(self)
Returns the program name
  error(self, msg)
We raise an exception instead of calling sys.exit
str format_help(self, formatter)
Returns the formatted help string
str get_prog_name(self)
Returns the program name
str get_usage(self)
Returns the usage string
str get_version(self)
Returns the version string
optparse.OptionContainer parseArgs(self, *args, **kwargs)
Parses the argument list
optparse.IndentedHelpFormatter _createHelpFormatter(self, *args, **kwargs)
Returns the option helper formatter
OptionHelper _createSvnmailerOptionHelper(self, background)
Returns the option parser helper class
    Inherited from OptionParser
  add_option_group(self, *args, **kwargs)
  check_values(self, values, args)
check_values(values : Values, args : [string]) -> (values : Values, args : [string]) Check that the supplied option values and leftover arguments are valid.
  disable_interspersed_args(self)
  enable_interspersed_args(self)
  format_option_help(self, formatter)
  get_default_values(self)
  get_option_group(self, opt_str)
  parse_args(self, args, values)
parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]).
  print_help(self, file)
print_help(file : file = stdout) Print an extended help message, listing all options and any help text provided with them, to 'file' (default stdout).
  print_usage(self, file)
print_usage(file : file = stdout) Print the usage message for the current program (self.usage) to 'file' (default stdout).
  print_version(self, file)
print_version(file : file = stdout) Print the version message for this program (self.version) to 'file' (default stdout).
  set_default(self, dest, value)
  set_defaults(self, **kwargs)
  set_usage(self, usage)
  _create_option_list(self)
  _get_args(self, args)
  _init_parsing_state(self)
  _match_long_opt(self, opt)
_match_long_opt(opt : string) -> string Determine which long option string 'opt' matches, ie.
  _populate_option_list(self, option_list, add_help)
  _process_args(self, largs, rargs, values)
_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'.
  _process_long_opt(self, rargs, values)
  _process_short_opts(self, rargs, values)
    Inherited from OptionContainer
  add_option(self, *args, **kwargs)
add_option(Option)...
  add_options(self, option_list)
  format_description(self, formatter)
  get_option(self, opt_str)
  has_option(self, opt_str)
  remove_option(self, opt_str)
  set_conflict_handler(self, handler)
  set_description(self, description)
  _check_conflict(self, option)
  _create_option_mappings(self)
  _share_option_mappings(self, parser)

Instance Variable Summary
OptionHelper _svnmailer_helper: The option parser helper instance

Class Variable Summary
    Inherited from OptionParser
list standard_option_list = []

Method Details

__init__(self, background=True)
(Constructor)

Initialization

@exception CommandlineError: The argument list was empty

Parameters:
background - Is daemonizing of the process allowed?
           (type=bool)
Overrides:
optparse.OptionParser.__init__

_get_prog_name(self)

Returns the program name
Returns:
The program name
           (type=str)

error(self, msg)

We raise an exception instead of calling sys.exit
Parameters:
msg - The error message
           (type=str)
Raises:
CommandlineError - command line error
Overrides:
optparse.OptionParser.error

format_help(self, formatter=None)

Returns the formatted help string

The string consists of the normal option help generated by the optparse module and a short description of the old style options. All text is tried to be wrapped to fit into the current terminal width.

Parameters:
formatter - unused
           (type=any)
Returns:
The formatted help string
           (type=str)
Overrides:
optparse.OptionParser.format_help

get_prog_name(self)

Returns the program name
Returns:
The program name
           (type=str)

get_usage(self)

Returns the usage string
Returns:
The usage string
           (type=str)
Overrides:
optparse.OptionParser.get_usage

get_version(self)

Returns the version string

The string consists of two lines. The first line contains the svnmailer version (like svnmailer-1.2.3) and the second line contains the svn version propagated by the bindings (like with svn 4.5.6 (revision 7))

Returns:
The version string
           (type=str)
Overrides:
optparse.OptionParser.get_version

parseArgs(self, *args, **kwargs)

Parses the argument list
Parameters:
args - Additional arguments for the parser
kwargs - Additional arguments for the parser
Returns:
The OptionContainer instance
           (type=optparse.OptionContainer)
Raises:
CommandlineError - The argument list was invalid

_createHelpFormatter(self, *args, **kwargs)

Returns the option helper formatter
Parameters:
args - Arguments for the formatter
kwargs - Arguments for the formatter
Returns:
The formatter instance
           (type=optparse.IndentedHelpFormatter)

_createSvnmailerOptionHelper(self, background)

Returns the option parser helper class

We delegate additional operations to an extra class in order to not pollute the OptionParser namespace which changes all the time.

Parameters:
background - Is daemonizing of the process allowed?
           (type=bool)
Returns:
A new OptionHelper instance
           (type=OptionHelper)

Instance Variable Details

_svnmailer_helper

The option parser helper instance
Type:
OptionHelper

Generated by Epydoc 2.0 on Sun Sep 25 20:49:14 2005 http://epydoc.sf.net