ConfigParser:

- ensure that option names in interpolations are handled by
  self.optionxform in the same way that other references to option
  names
- add tests, documentation
(closes SF bug #857881, patch #865455)
This commit is contained in:
Fred Drake 2004-05-18 02:25:51 +00:00
parent beddfcb6d0
commit bc12b01d83
3 changed files with 24 additions and 5 deletions

View file

@ -62,6 +62,13 @@ and \method{items()} methods. The values in \var{defaults} must be
appropriate for the \samp{\%()s} string interpolation. Note that
\var{__name__} is an intrinsic default; its value is the section name,
and will override any value provided in \var{defaults}.
All option names used in interpolation will be passed through the
\method{optionxform()} method just like any other option name
reference. For example, using the default implementation of
\method{optionxform()} (which converts option names to lower case),
the values \samp{foo \%(bar)s} and \samp{foo \%(BAR)s} are
equivalent.
\end{classdesc}
\begin{classdesc}{SafeConfigParser}{\optional{defaults}}
@ -271,6 +278,8 @@ option names case sensitive.
The \class{ConfigParser} class extends some methods of the
\class{RawConfigParser} interface, adding some optional arguments.
The \class{SafeConfigParser} class implements the same extended
interface.
\begin{methoddesc}{get}{section, option\optional{, raw\optional{, vars}}}
Get an \var{option} value for the named \var{section}. All the