rest25/library/mimetools.rst => rest262/library/mimetools.rst
f1
2:mod:`mimetools` --- Tools for parsing MIME messages
3====================================================
4
5.. module:: mimetools
6   :synopsis: Tools for parsing MIME-style message bodies.
n7+   :deprecated:
7
8
9.. deprecated:: 2.3
10   The :mod:`email` package should be used in preference to the :mod:`mimetools`
n11-   module.  This module is present only to maintain backward compatibility.
n12+   module.  This module is present only to maintain backward compatibility, and
13+   it has been removed in 3.x.
12
13.. index:: module: rfc822
14
15This module defines a subclass of the :mod:`rfc822` module's :class:`Message`
16class and a number of utility functions that are useful for the manipulation for
17MIME multipart or encoded message.
18
19It defines the following items:
67      Comprehensive email handling package; supersedes the :mod:`mimetools` module.
68
69   Module :mod:`rfc822`
70      Provides the base class for :class:`mimetools.Message`.
71
72   Module :mod:`multifile`
73      Support for reading files which contain distinct parts, such as MIME data.
74
n75-   http://www.cs.uu.nl/wais/html/na-dir/mail/mime-faq/.html
n77+   http://faqs.cs.uu.nl/na-dir/mail/mime-faq/.html
76      The MIME Frequently Asked Questions document.  For an overview of MIME, see the
77      answer to question 1.1 in Part 1 of this document.
78
79
80.. _mimetools-message-objects:
81
82Additional Methods of Message Objects
83-------------------------------------
84
85The :class:`Message` class defines the following methods in addition to the
86:class:`rfc822.Message` methods:
87
88
n89-.. method:: XXX Class.getplist()
n91+.. method:: Message.getplist()
90
91   Return the parameter list of the :mailheader:`Content-Type` header. This is a
92   list of strings.  For parameters of the form ``key=value``, *key* is converted
93   to lower case but *value* is not.  For example, if the message contains the
94   header ``Content-type: text/html; spam=1; Spam=2; Spam`` then :meth:`getplist`
95   will return the Python list ``['spam=1', 'spam=2', 'Spam']``.
96
97
n98-.. method:: XXX Class.getparam(name)
n100+.. method:: Message.getparam(name)
99
100   Return the *value* of the first parameter (as returned by :meth:`getplist`) of
101   the form ``name=value`` for the given *name*.  If *value* is surrounded by
102   quotes of the form '``<``...\ ``>``' or '``"``...\ ``"``', these are removed.
103
104
n105-.. method:: XXX Class.getencoding()
n107+.. method:: Message.getencoding()
106
107   Return the encoding specified in the :mailheader:`Content-Transfer-Encoding`
108   message header.  If no such header exists, return ``'7bit'``.  The encoding is
109   converted to lower case.
110
111
n112-.. method:: XXX Class.gettype()
n114+.. method:: Message.gettype()
113
114   Return the message type (of the form ``type/subtype``) as specified in the
115   :mailheader:`Content-Type` header.  If no such header exists, return
116   ``'text/plain'``.  The type is converted to lower case.
117
118
n119-.. method:: XXX Class.getmaintype()
n121+.. method:: Message.getmaintype()
120
121   Return the main type as specified in the :mailheader:`Content-Type` header.  If
122   no such header exists, return ``'text'``.  The main type is converted to lower
123   case.
124
125
t126-.. method:: XXX Class.getsubtype()
t128+.. method:: Message.getsubtype()
127
128   Return the subtype as specified in the :mailheader:`Content-Type` header.  If no
129   such header exists, return ``'plain'``.  The subtype is converted to lower case.
130
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op