Movatterモバイル変換


[0]ホーム

URL:


Up one LevelPython Library ReferenceContentsModule IndexIndex


7.5.1 Additional Methods of Message Objects

TheMessage class defines the following methods inaddition to therfc822.Message methods:

getplist()
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'].

getparam(name)
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.

getencoding()
Return the encoding specified in theContent-Transfer-Encoding: message header. If no suchheader exists, return'7bit'. The encoding is converted tolower case.

gettype()
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.

getmaintype()
Return the main type as specified in theContent-Type:header. If no such header exists, return'text'. The maintype is converted to lower case.

getsubtype()
Return the subtype as specified in theContent-Type:header. If no such header exists, return'plain'. The subtypeis converted to lower case.


Up one LevelPython Library ReferenceContentsModule IndexIndex

Release 2.5.2, documentation updated on 21st February, 2008.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2025 Movatter.jp