summaryrefslogtreecommitdiffstats
path: root/Doc/library/email.parser.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-05-17 11:28:33 (GMT)
committerGeorg Brandl <georg@python.org>2009-05-17 11:28:33 (GMT)
commit3f076d8b3df3a1aa3228bbe993d4f37d577fcc2f (patch)
tree5af0b00e845c6bad851015467bca470aaeb78c62 /Doc/library/email.parser.rst
parentfe66fc120cfcc10fc38990c6c9c3c8a0b4d585bc (diff)
downloadcpython-3f076d8b3df3a1aa3228bbe993d4f37d577fcc2f.zip
cpython-3f076d8b3df3a1aa3228bbe993d4f37d577fcc2f.tar.gz
cpython-3f076d8b3df3a1aa3228bbe993d4f37d577fcc2f.tar.bz2
Use new optional argument style in email docs.
Diffstat (limited to 'Doc/library/email.parser.rst')
-rw-r--r--Doc/library/email.parser.rst14
1 files changed, 6 insertions, 8 deletions
diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst
index ec2e71b..3de5c31 100644
--- a/Doc/library/email.parser.rst
+++ b/Doc/library/email.parser.rst
@@ -58,13 +58,12 @@ list of defects that it can find.
Here is the API for the :class:`FeedParser`:
-.. class:: FeedParser([_factory])
+.. class:: FeedParser(_factory=email.message.Message)
Create a :class:`FeedParser` instance. Optional *_factory* is a no-argument
callable that will be called whenever a new message object is needed. It
defaults to the :class:`email.message.Message` class.
-
.. method:: feed(data)
Feed the :class:`FeedParser` some more data. *data* should be a string
@@ -74,7 +73,6 @@ Here is the API for the :class:`FeedParser`:
carriage return, newline, or carriage return and newline (they can even be
mixed).
-
.. method:: close()
Closing a :class:`FeedParser` completes the parsing of all previously fed
@@ -96,7 +94,7 @@ as a string. :class:`HeaderParser` has the same API as the :class:`Parser`
class.
-.. class:: Parser([_class])
+.. class:: Parser(_class=email.message.Message, strict=None)
The constructor for the :class:`Parser` class takes an optional argument
*_class*. This must be a callable factory (such as a function or a class), and
@@ -115,7 +113,7 @@ class.
The other public :class:`Parser` methods are:
- .. method:: parse(fp[, headersonly])
+ .. method:: parse(fp, headersonly=False)
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
@@ -129,7 +127,7 @@ class.
Optional *headersonly* is as with the :meth:`parse` method.
- .. method:: parsestr(text[, headersonly])
+ .. method:: parsestr(text, headersonly=False)
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
@@ -147,14 +145,14 @@ in the top-level :mod:`email` package namespace.
.. currentmodule:: email
-.. function:: message_from_string(s[, _class[, strict]])
+.. function:: message_from_string(s[, _class][, strict])
Return a message object structure from a string. This is exactly equivalent to
``Parser().parsestr(s)``. Optional *_class* and *strict* are interpreted as
with the :class:`Parser` class constructor.
-.. function:: message_from_file(fp[, _class[, strict]])
+.. function:: message_from_file(fp[, _class][, strict])
Return a message object structure tree from an open file object. This is
exactly equivalent to ``Parser().parse(fp)``. Optional *_class* and *strict*