Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
df225148
Commit
df225148
authored
Jan 26, 1999
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-format the module docstring and document the new get() argument.
parent
e000a776
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
26 deletions
+29
-26
Lib/ConfigParser.py
Lib/ConfigParser.py
+29
-26
No files found.
Lib/ConfigParser.py
View file @
df225148
...
@@ -24,34 +24,37 @@ ConfigParser -- responsible for for parsing a list of
...
@@ -24,34 +24,37 @@ ConfigParser -- responsible for for parsing a list of
methods:
methods:
__init__(defaults=None) -- create the parser and specify a
__init__(defaults=None)
dictionary of intrinsic defaults. The
create the parser and specify a dictionary of intrinsic defaults. The
keys must be strings, the values must
keys must be strings, the values must be appropriate for %()s string
be appropriate for %()s string
interpolation. Note that `__name__' is always an intrinsic default;
interpolation. Note that `__name__' is
it's value is the section's name.
always an intrinsic default; it's value
is the section's name.
sections() -- return all the configuration section names, sans DEFAULT
sections()
return all the configuration section names, sans DEFAULT
options(section)
-- return list of configuration options for the named
options(section)
section
return list of configuration options for the named
section
read(*filenames) -- read and parse the list of named configuration files
read(*filenames)
read and parse the list of named configuration files
get(section, option, raw=0) -- return a string value for the named
get(section, option, raw=0, vars=None)
option. All % interpolations are
return a string value for the named option. All % interpolations are
expanded in the return values, based on
expanded in the return values, based on the defaults passed into the
the defaults passed into the constructor
constructor and the DEFAULT section. Additional substitutions may be
and the DEFAULT section.
provided using the `vars' argument, which must be a dictionary whose
contents override any pre-existing defaults.
getint(section, options) -- like get(), but convert value to an integer
getint(section, options)
like get(), but convert value to an integer
getfloat(section, options) -- like get(), but convert value to a float
getfloat(section, options)
like get(), but convert value to a float
getboolean(section, options)
-- like get(), but convert value to
getboolean(section, options)
a boolean (currently defined as 0
like get(), but convert value to a boolean (currently defined as 0 or
or
1, only)
1, only)
"""
"""
import
sys
import
sys
...
@@ -176,11 +179,11 @@ class ConfigParser:
...
@@ -176,11 +179,11 @@ class ConfigParser:
def
get
(
self
,
section
,
option
,
raw
=
0
,
vars
=
None
):
def
get
(
self
,
section
,
option
,
raw
=
0
,
vars
=
None
):
"""Get an option value for a given section.
"""Get an option value for a given section.
All % interpolations are expanded in the return values, based
All % interpolations are expanded in the return values, based
on the
on the defaults passed into the constructor, unless the optional
defaults passed into the constructor, unless the optional argument
argument `raw' is true. Additional substitutions may be provided
`raw' is true. Additional substitutions may be provided using the
using the vars keyword argument, which override any pre-existing
`vars' argument, which must be a dictionary whose contents overrides
defaults.
any pre-existing
defaults.
The section DEFAULT is special.
The section DEFAULT is special.
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment