| |
- exceptions.Exception
-
- OptionError
- NoDefault
- NoValue
- OptionContainer
- OptionParser
- baseOption
-
- boolOption
- floatOption
- intOption
- listOption
- stringOption
class OptionParser |
| |
Methods defined here:
- __init__(self)
- add(self, otype, *args, **kwargs)
- help(self, width=20)
- load_ConfigParser(self, filename, include_unknown=1)
- Load the config file and return an OptionContainer
If filename does not exist, an empty OC will be returned. If
it exists but cannot be read, an OptionError will be raised.
include_unknown determines the behavior if an unrecognized option
is encountered. It has 4 possible values:
1 include the option/value
0 ignore the option/value
-1 raise an OptionError exception
callback if include_unknown is callable, it will be called
like this:
ret = include_unknown((section, option), value)
It can return one of [1, 0, -1], which will then be
interpreted as above. It is also reasonable to take
some action (print stuff, for example) or raise an
exception (which will NOT be caught here).
- load_defaults(self)
- load_getopt(self, cmd_line)
- overlay(self, oc_list, keep_unknown=1)
- sample_file(self)
|
class baseOption |
| |
Methods defined here:
- __init__(self, name, short=None, long=None, default=<class kibot.OptionParser.NoDefault>, cp_name=(), desc=None)
- overlay(self, lower, upper)
- value_from_ConfigParser(self, st)
- value_from_getopt(self, st)
- value_from_string(self, st)
Data and other attributes defined here:
- getopt_takes_arg = 1
|
class boolOption(baseOption) |
| |
Methods defined here:
- value_from_getopt(self, st)
- value_from_string(self, st)
Data and other attributes defined here:
- false_regex = <_sre.SRE_Pattern object>
- getopt_takes_arg = 0
- true_regex = <_sre.SRE_Pattern object>
Methods inherited from baseOption:
- __init__(self, name, short=None, long=None, default=<class kibot.OptionParser.NoDefault>, cp_name=(), desc=None)
- overlay(self, lower, upper)
- value_from_ConfigParser(self, st)
|
class floatOption(baseOption) |
| |
Methods defined here:
- value_from_string(self, st)
Methods inherited from baseOption:
- __init__(self, name, short=None, long=None, default=<class kibot.OptionParser.NoDefault>, cp_name=(), desc=None)
- overlay(self, lower, upper)
- value_from_ConfigParser(self, st)
- value_from_getopt(self, st)
Data and other attributes inherited from baseOption:
- getopt_takes_arg = 1
|
class intOption(baseOption) |
| |
Methods defined here:
- value_from_string(self, st)
Methods inherited from baseOption:
- __init__(self, name, short=None, long=None, default=<class kibot.OptionParser.NoDefault>, cp_name=(), desc=None)
- overlay(self, lower, upper)
- value_from_ConfigParser(self, st)
- value_from_getopt(self, st)
Data and other attributes inherited from baseOption:
- getopt_takes_arg = 1
|
class listOption(baseOption) |
| |
Methods defined here:
- overlay(self, lower, upper)
- value_from_string(self, st)
Data and other attributes defined here:
- listsplit_re = <_sre.SRE_Pattern object>
Methods inherited from baseOption:
- __init__(self, name, short=None, long=None, default=<class kibot.OptionParser.NoDefault>, cp_name=(), desc=None)
- value_from_ConfigParser(self, st)
- value_from_getopt(self, st)
Data and other attributes inherited from baseOption:
- getopt_takes_arg = 1
|
class stringOption(baseOption) |
| |
Methods inherited from baseOption:
- __init__(self, name, short=None, long=None, default=<class kibot.OptionParser.NoDefault>, cp_name=(), desc=None)
- overlay(self, lower, upper)
- value_from_ConfigParser(self, st)
- value_from_getopt(self, st)
- value_from_string(self, st)
Data and other attributes inherited from baseOption:
- getopt_takes_arg = 1
| |