]> granicus.if.org Git - python/commitdiff
Describe the HeaderParser class.
authorBarry Warsaw <barry@python.org>
Thu, 11 Oct 2001 15:45:05 +0000 (15:45 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 11 Oct 2001 15:45:05 +0000 (15:45 +0000)
Doc/lib/emailparser.tex

index 0b2cec0ea9db2a74caef365d57cb562bbd32a365..724de081aa58aeaec8abe77f1d81c9fe6c18613e 100644 (file)
@@ -24,6 +24,17 @@ no magical connection between the \module{email} package's bundled
 parser and the \class{Message} class, so your custom parser can create
 message object trees in any way it find necessary.
 
+The primary parser class is \class{Parser} which parses both the
+headers and the payload of the message.  In the case of
+\mimetype{multipart} messages, it will recursively parse the body of
+the container message.  The \module{email.Parser} module also provides
+a second class, called \class{HeaderParser} which can be used if
+you're only interested in the headers of the message.
+\class{HeaderParser} can be much faster in this situations, since it
+does not attempt to parse the message body, instead setting the
+payload to the raw body as a string.  \class{HeaderParser} has the
+same API as the \class{Parser} class.
+
 \subsubsection{Parser class API}
 
 \begin{classdesc}{Parser}{\optional{_class}}