|
|
__init__(self,
defaults=None,
permit_includes=True,
use_ordered_sections=False,
strict_substitution=False)
Construct a new Configuration object. |
|
|
|
dict
|
defaults(self)
Returns the instance-wide defaults. |
|
|
|
|
sections(self)
Get the list of available sections, not including DEFAULT. |
|
|
|
|
add_section(self,
section)
Add a section named section to the instance. |
|
|
|
bool
|
has_section(self,
section)
Determine whether a section exists in the configuration. |
|
|
|
list
|
options(self,
section)
Get a list of options available in the specified section. |
|
|
|
bool
|
has_option(self,
section,
option)
Determine whether a section has a specific option. |
|
|
|
list
|
read(self,
filenames)
Attempt to read and parse a list of filenames or URLs, returning a
list of filenames or URLs which were successfully parsed. |
|
|
|
|
readfp(self,
fp,
filename=None)
Read and parse configuration data from a file or file-like object. |
|
|
|
str
|
get(self,
section,
option,
optional=False)
Get an option from a section. |
|
|
|
int
|
getint(self,
section,
option,
optional=False)
Convenience method that coerces the result of a call to
get() to an int. |
|
|
|
float
|
getfloat(self,
section,
option,
optional=False)
Convenience method that coerces the result of a call to get() to a
float. |
|
|
|
bool
|
getboolean(self,
section,
option,
optional=False)
Convenience method that coerces the result of a call to get() to a
boolean. |
|
|
|
bool
|
getlist(self,
section,
option,
sep=None,
optional=False)
Convenience method that coerces the result of a call to get() to a
list. |
|
|
|
str
|
get_one_of(self,
section,
options,
optional=False,
default=None,
value_type=str)
Retrieve at most one of a list or set of options from a section. |
|
|
|
list
|
items(self,
section)
Get all items in a section. |
|
|
|
|
set(self,
section,
option,
value)
If the given section exists, set the given option to the specified
value; otherwise raise NoSectionError. |
|
|
|
|
write(self,
fileobj)
Write a representation of the configuration to the specified file-like
object. |
|
|
|
|
|
|
|
optionxform(self,
option_name)
Transforms the option name in option_name as found in an input
file or as passed in by client code to the form that should be used in
the internal structures. |
|
|
|
Inherited from ConfigParser.RawConfigParser:
remove_option
|