| Home | Trees | Indices | Help |
|
|---|
|
|
optparse.OptionContainer --+
|
optparse.OptionParser --+
|
ProcImapOptParser
A special OptionParser for ProcImap. This takes the exact same arguments as optparse.OptionParser.
However, there is a predefined option '-p' or '--profile'. If not given explicitely, this option takes the value of the environment variable PROC_IMAP_PROFILE. If the option is not given, neither explicitely nor implicitely through the envirnoment variable, ProcImapOptParser will shoot down the program it's running in with an error message.
You can use ProcImapOptParser in this manner:
>>> opt = ProcImapOptParser() >>> (options, args) = opt.parse_args(args=sys.argv)
if sys.argv included e.g. '-p mailboxes.cfg', options.profile will NOT be the string 'mailboxes.cfg', but instead will be an instance of MailboxFactory, generated from the file mailboxes.cfg.
ProcImapOptParser also has a modified default formatter that allows explicit linebreaks (for paragraphs) in help-generating arguments like 'epilogue'.
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
See documentation of optparse.OptionParser for arguments.
|
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:]). Any errors result in a call to 'error()', which
by default prints the usage message to stderr and calls
sys.exit() with an error message. On success returns a pair
(values, args) where 'values' is an Values instance (with all
your option values) and 'args' is the list of arguments left
over after parsing options.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Fri Aug 6 18:48:54 2010 | http://epydoc.sourceforge.net |