diff options
author | R David Murray <rdmurray@bitdance.com> | 2015-05-16 19:41:07 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2015-05-16 19:41:07 (GMT) |
commit | b744f3a45e3228ea2b344c8cf9424e2592dc93b7 (patch) | |
tree | d642d35aa8a2fb02ce9ef8ba8354126d366ff6f0 /Doc | |
parent | b9cec6a30f77c4c0ab208053ffafc02fddd01962 (diff) | |
download | cpython-b744f3a45e3228ea2b344c8cf9424e2592dc93b7.zip cpython-b744f3a45e3228ea2b344c8cf9424e2592dc93b7.tar.gz cpython-b744f3a45e3228ea2b344c8cf9424e2592dc93b7.tar.bz2 |
#21083: add get_content_disposition method to email.message.
Patch by Abhilash Raj.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/email.message.rst | 9 | ||||
-rw-r--r-- | Doc/whatsnew/3.5.rst | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst index aeea942..b91f26d 100644 --- a/Doc/library/email.message.rst +++ b/Doc/library/email.message.rst @@ -578,6 +578,15 @@ Here are the methods of the :class:`Message` class: will be *failobj*. + .. method:: get_content_disposition() + + Return the lowercased value (without parameters) of the message's + :mailheader:`Content-Disposition` header if it has one, or ``None``. The + possible values for this method are *inline*, *attachment* or ``None`` + if the message follows :rfc:`2183`. + + .. versionadded:: 3.5 + .. method:: walk() The :meth:`walk` method is an all-purpose generator which can be used to diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 4b36315..0360de4 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -348,6 +348,14 @@ doctest *module* contains no docstrings instead of raising :exc:`ValueError`. (Contributed by Glenn Jones in :issue:`15916`.) +email +----- + +* A new method :meth:`~email.message.Message.get_content_disposition` provides + easy access to a canonical value for the :mailheader:`Content-Disposition` + header (``None`` if there is no such header). (Contributed by Abhilash Raj + in :issue:`21083`.) + glob ---- |