Commit a1f75b33 authored by Fred Drake's avatar Fred Drake

API documentation for ZConfig.Interpolation.

parent 6b7305e9
...@@ -66,5 +66,54 @@ ...@@ -66,5 +66,54 @@
\modulesynopsis{Parser for an alternate syntax} \modulesynopsis{Parser for an alternate syntax}
\section{\module{ZConfig.Interpolation} --- String interpolation}
\declaremodule{}{ZConfig.Interpolation}
\modulesynopsis{Shell-style string interpolation helper}
This module provides a basic substitution facility similar to that
found in the Bourne shell (\program{sh} on most \UNIX{} platforms).
XXX need to explain the syntax here
For these functions, the \var{mapping} argument can be a \class{dict},
or any type that supports the \method{get()} method of the mapping
protocol.
\begin{funcdesc}{interpolate}{s, mapping}
Interpolate values from \var{mapping} into \var{s}. Replacement
values are copied into the result without further interpretation.
Raises \exception{InterpolationSyntaxError} if there are malformed
constructs in \var{s}.
\end{funcdesc}
\begin{funcdesc}{get}{mapping, name\optional{, default}}
Return the value for \var{name} from \var{mapping}, interpolating
values recursively if needed. Raises
\exception{InterpolationSyntaxError} if there are malformed
constructs in \var{s}, or \exception{InterpolationRecursionError} if
any name expands to include a reference to itself either directly or
indirectly.
\end{funcdesc}
\begin{excdesc}{InterpolationError}
Base class for errors raised by the \module{ZConfig.Interpolation}
module. Instances provide the attributes \member{message} and
\member{context}. \member{message} contains a description of the
error. \member{context} is either \code{None} or a list of names
that have been looked up in the case of nested interpolation.
\end{excdesc}
\begin{excdesc}{InterpolationSyntaxError}
Raised when interpolation source text contains syntactical errors.
\end{excdesc}
\begin{excdesc}{InterpolationRecursionError}
Raised when a nested interpolation is recursive. The
\member{context} attribute will always be a list for this
exception. An additional attribute, \member{name}, gives the name
for which an recursive reference was detected.
\end{excdesc}
\end{document} \end{document}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment