Movatterモバイル変換
[0]ホーム
7.5.1 Additional Methods of Message Objects
TheMessage class defines the following methods inaddition to therfc822.Message methods:
- Return the parameter list of theContent-Type: header.This is a list of strings. For parameters of the form"key=value",key is converted to lower case butvalue is not. For example, if the message contains the header"Content-type: text/html; spam=1; Spam=2; Spam" thengetplist() will return the Python list
['spam=1','spam=2', 'Spam'].
- Return thevalue of the first parameter (as returned bygetplist()) of the form "name=value" for thegivenname. Ifvalue is surrounded by quotes of the form`
<...>' or `"..."', these are removed.
- Return the encoding specified in theContent-Transfer-Encoding: message header. If no suchheader exists, return
'7bit'. The encoding is converted tolower case.
- Return the message type (of the form "type/subtype")as specified in theContent-Type: header. If no suchheader exists, return
'text/plain'. The type is converted tolower case.
- Return the main type as specified in theContent-Type:header. If no such header exists, return
'text'. The maintype is converted to lower case.
- Return the subtype as specified in theContent-Type:header. If no such header exists, return
'plain'. The subtypeis converted to lower case.
Release 2.5.2, documentation updated on 21st February, 2008. SeeAbout this document... for information on suggesting changes.
[8]ページ先頭