summaryrefslogtreecommitdiffstats
path: root/Doc/library/email.parser.rst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-04-25 01:29:10 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-04-25 01:29:10 (GMT)
commitc7b05920d6536f7edba098d5018a470d35f2e864 (patch)
treece0f68baf5c7794f235604c64cde02c12aeed3de /Doc/library/email.parser.rst
parent1c596d5604e4fc79944281ddc5baa666f6e27e85 (diff)
downloadcpython-c7b05920d6536f7edba098d5018a470d35f2e864.zip
cpython-c7b05920d6536f7edba098d5018a470d35f2e864.tar.gz
cpython-c7b05920d6536f7edba098d5018a470d35f2e864.tar.bz2
reformat some documentation of classes so methods and attributes are under the class directive
Diffstat (limited to 'Doc/library/email.parser.rst')
-rw-r--r--Doc/library/email.parser.rst66
1 files changed, 34 insertions, 32 deletions
diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst
index 048ed22..e47a8ae 100644
--- a/Doc/library/email.parser.rst
+++ b/Doc/library/email.parser.rst
@@ -67,20 +67,21 @@ Here is the API for the :class:`FeedParser`:
defaults to the :class:`email.message.Message` class.
-.. method:: FeedParser.feed(data)
+ .. method:: feed(data)
- Feed the :class:`FeedParser` some more data. *data* should be a string
- containing one or more lines. The lines can be partial and the
- :class:`FeedParser` will stitch such partial lines together properly. The lines
- in the string can have any of the common three line endings, carriage return,
- newline, or carriage return and newline (they can even be mixed).
+ Feed the :class:`FeedParser` some more data. *data* should be a string
+ containing one or more lines. The lines can be partial and the
+ :class:`FeedParser` will stitch such partial lines together properly. The
+ lines in the string can have any of the common three line endings,
+ carriage return, newline, or carriage return and newline (they can even be
+ mixed).
-.. method:: FeedParser.close()
+ .. method:: close()
- Closing a :class:`FeedParser` completes the parsing of all previously fed data,
- and returns the root message object. It is undefined what happens if you feed
- more data to a closed :class:`FeedParser`.
+ Closing a :class:`FeedParser` completes the parsing of all previously fed
+ data, and returns the root message object. It is undefined what happens
+ if you feed more data to a closed :class:`FeedParser`.
Parser class API
@@ -119,39 +120,40 @@ class.
.. versionchanged:: 2.4
The *strict* flag was deprecated.
-The other public :class:`Parser` methods are:
+ The other public :class:`Parser` methods are:
-.. method:: Parser.parse(fp[, headersonly])
+ .. method:: parse(fp[, headersonly])
- Read all the data from the file-like object *fp*, parse the resulting text, and
- return the root message object. *fp* must support both the :meth:`readline` and
- the :meth:`read` methods on file-like objects.
+ Read all the data from the file-like object *fp*, parse the resulting
+ text, and return the root message object. *fp* must support both the
+ :meth:`readline` and the :meth:`read` methods on file-like objects.
- The text contained in *fp* must be formatted as a block of :rfc:`2822` style
- headers and header continuation lines, optionally preceded by a envelope
- header. The header block is terminated either by the end of the data or by a
- blank line. Following the header block is the body of the message (which may
- contain MIME-encoded subparts).
+ The text contained in *fp* must be formatted as a block of :rfc:`2822`
+ style headers and header continuation lines, optionally preceded by a
+ envelope header. The header block is terminated either by the end of the
+ data or by a blank line. Following the header block is the body of the
+ message (which may contain MIME-encoded subparts).
- Optional *headersonly* is as with the :meth:`parse` method.
+ Optional *headersonly* is as with the :meth:`parse` method.
- .. versionchanged:: 2.2.2
- The *headersonly* flag was added.
+ .. versionchanged:: 2.2.2
+ The *headersonly* flag was added.
-.. method:: Parser.parsestr(text[, headersonly])
+ .. method:: parsestr(text[, headersonly])
- Similar to the :meth:`parse` method, except it takes a string object instead of
- a file-like object. Calling this method on a string is exactly equivalent to
- wrapping *text* in a :class:`StringIO` instance first and calling :meth:`parse`.
+ Similar to the :meth:`parse` method, except it takes a string object
+ instead of a file-like object. Calling this method on a string is exactly
+ equivalent to wrapping *text* in a :class:`StringIO` instance first and
+ calling :meth:`parse`.
- Optional *headersonly* is a flag specifying whether to stop parsing after
- reading the headers or not. The default is ``False``, meaning it parses the
- entire contents of the file.
+ Optional *headersonly* is a flag specifying whether to stop parsing after
+ reading the headers or not. The default is ``False``, meaning it parses
+ the entire contents of the file.
- .. versionchanged:: 2.2.2
- The *headersonly* flag was added.
+ .. versionchanged:: 2.2.2
+ The *headersonly* flag was added.
Since creating a message object structure from a string or a file object is such
a common task, two functions are provided as a convenience. They are available