summaryrefslogtreecommitdiff
path: root/Lib/email/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/email/message.py')
-rw-r--r--Lib/email/message.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py
index 3d3138fe27..a892012c3f 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -927,6 +927,18 @@ class Message:
"""
return [part.get_content_charset(failobj) for part in self.walk()]
+ def get_content_disposition(self):
+ """Return the message's content-disposition if it exists, or None.
+
+ The return values can be either 'inline', 'attachment' or None
+ according to the rfc2183.
+ """
+ value = self.get('content-disposition')
+ if value is None:
+ return None
+ c_d = _splitparam(value)[0].lower()
+ return c_d
+
# I.e. def walk(self): ...
from email.iterators import walk