optparse - a powerful, extensible, and easy-to-use option parser.
By Greg Ward <[email protected]>
Originally distributed as Optik; see http://optik.sourceforge.net/ .
If you have problems with this module, please do not file bugs,
patches, or feature requests with Python; instead, use Optik's
SourceForge project page:
http://sourceforge.net/projects/optik
For support, use the [email protected] mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Imported modules
|
|
from gettext import gettext
import os
import sys
import textwrap
import types
|
Functions
|
|
_match_abbrev
_repr
check_builtin
check_choice
|
|
_match_abbrev
|
_match_abbrev ( s, wordmap )
_match_abbrev(s : string, wordmap : {string : Option}) -> string
Return the string key in wordmap for which s is an unambiguous
abbreviation. If s is found to be ambiguous or doesn't match any of
words , raise BadOptionError.
Exceptions
|
|
BadOptionError( _( "no such option: %s" ) % s )
BadOptionError(_( "ambiguous option: %s (%s?)" ) %(s, ", ".join( possibilities ) ) )
|
|
|
_repr
|
_repr ( self )
|
|
check_builtin
|
check_builtin (
option,
opt,
value,
)
Exceptions
|
|
OptionValueError(_( "option %s: invalid %s value: %r" ) %( opt, what, value ) )
|
|
|
check_choice
|
check_choice (
option,
opt,
value,
)
Exceptions
|
|
OptionValueError(_( "option %s: invalid choice: %r (choose from %s)" ) %( opt, value, choices ) )
|
|
Classes
|
|
|
|