mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Re-order some method descriptions for a more logical grouping.
(Based on reader comment!)
This commit is contained in:
parent
9eb41557ef
commit
f0ebbe0bd0
1 changed files with 25 additions and 25 deletions
|
|
@ -39,19 +39,6 @@ own pattern for section-divider and end-marker lines.
|
|||
|
||||
A \class{MultiFile} instance has the following methods:
|
||||
|
||||
\begin{methoddesc}{push}{str}
|
||||
Push a boundary string. When an appropriately decorated version of
|
||||
this boundary is found as an input line, it will be interpreted as a
|
||||
section-divider or end-marker. All subsequent
|
||||
reads will return the empty string to indicate end-of-file, until a
|
||||
call to \method{pop()} removes the boundary a or \method{next()} call
|
||||
reenables it.
|
||||
|
||||
It is possible to push more than one boundary. Encountering the
|
||||
most-recently-pushed boundary will return EOF; encountering any other
|
||||
boundary will raise an error.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{readline}{str}
|
||||
Read a line. If the line is data (not a section-divider or end-marker
|
||||
or real EOF) return it. If the line matches the most-recently-stacked
|
||||
|
|
@ -71,18 +58,6 @@ Read all lines, up to the next section. Return them as a single
|
|||
(multiline) string. Note that this doesn't take a size argument!
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{next}{}
|
||||
Skip lines to the next section (that is, read lines until a
|
||||
section-divider or end-marker has been consumed). Return true if
|
||||
there is such a section, false if an end-marker is seen. Re-enable
|
||||
the most-recently-pushed boundary.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{pop}{}
|
||||
Pop a section boundary. This boundary will no longer be interpreted
|
||||
as EOF.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{seek}{pos\optional{, whence}}
|
||||
Seek. Seek indices are relative to the start of the current section.
|
||||
The \var{pos} and \var{whence} arguments are interpreted as for a file
|
||||
|
|
@ -93,6 +68,13 @@ seek.
|
|||
Return the file position relative to the start of the current section.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{next}{}
|
||||
Skip lines to the next section (that is, read lines until a
|
||||
section-divider or end-marker has been consumed). Return true if
|
||||
there is such a section, false if an end-marker is seen. Re-enable
|
||||
the most-recently-pushed boundary.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{is_data}{str}
|
||||
Return true if \var{str} is data and false if it might be a section
|
||||
boundary. As written, it tests for a prefix other than \code{'-}\code{-'} at
|
||||
|
|
@ -104,6 +86,24 @@ boundary tests; if it always returns false it will merely slow
|
|||
processing, not cause it to fail.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{push}{str}
|
||||
Push a boundary string. When an appropriately decorated version of
|
||||
this boundary is found as an input line, it will be interpreted as a
|
||||
section-divider or end-marker. All subsequent
|
||||
reads will return the empty string to indicate end-of-file, until a
|
||||
call to \method{pop()} removes the boundary a or \method{next()} call
|
||||
reenables it.
|
||||
|
||||
It is possible to push more than one boundary. Encountering the
|
||||
most-recently-pushed boundary will return EOF; encountering any other
|
||||
boundary will raise an error.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{pop}{}
|
||||
Pop a section boundary. This boundary will no longer be interpreted
|
||||
as EOF.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{section_divider}{str}
|
||||
Turn a boundary into a section-divider line. By default, this
|
||||
method prepends \code{'-}\code{-'} (which MIME section boundaries have) but
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue