# ``twisted`.`mail`.`imap4`.`_SinglepartMessageStructure``

class documentation

`class _SinglepartMessageStructure(_MessageStructure): (source)`

Known subclasses: `twisted.mail.imap4._RFC822MessageStructure`, `twisted.mail.imap4._TextMessageStructure`

View In Hierarchy

`_SinglepartMessageStructure` represents the message structure of a non-multipart/* message.

Method | `__init__` |
Method | `encode` | Construct and return a list of the basic and extended fields for a single-part message. The list suitable to be encoded into a BODY or BODYSTRUCTURE response.
Instance Variable | `attrs` | Undocumented
Instance Variable | `main` | Undocumented
Instance Variable | `subtype` | Undocumented
Method | `_basicFields` | Return a list of the basic fields for a single-part message.
Method | `_extended` | The extension data of a non-multipart body part are in the following order:
Constant | `_HEADERS` | Undocumented

Inherited from `_MessageStructure`:

Instance Variable | `message` | Undocumented
Method | `_disposition` | Parse a Content-Disposition header into a two-sequence of the disposition and a flattened list of its parameters.
Method | `_unquotedAttrs` |

def __init__(self, message, main, subtype, attrs): (source)
overrides `twisted.mail.imap4._MessageStructure.__init__`

Parameters
message | An `IMessagePart` provider which this structure object reports on.
main | A `str` giving the main MIME type of the message (for example, `"text"`).
subtype | A `str` giving the MIME subtype of the message (for example, `"plain"`).
attrs | A `dict` giving the parameters of the Content-Type header of the message.

def encode(self, extended): (source)
overridden in `twisted.mail.imap4._RFC822MessageStructure`, `twisted.mail.imap4._TextMessageStructure`
Construct and return a list of the basic and extended fields for a single-part message. The list suitable to be encoded into a BODY or BODYSTRUCTURE response.
attrs = (source)
overrides `twisted.mail.imap4._MessageStructure.attrs`

Undocumented

main = (source)

Undocumented

subtype = (source)

Undocumented

def _basicFields(self): (source)
Return a list of the basic fields for a single-part message.
def _extended(self): (source)

The extension data of a non-multipart body part are in the following order:

1. body MD5

   A string giving the body MD5 value as defined in [MD5].

2. body disposition

   A parenthesized list with the same content and function as the body disposition for a multipart body part.

3. body language

   A string or parenthesized list giving the body language value as defined in [LANGUAGE-TAGS].

4. body location

   A string list giving the body content URI as defined in [LOCATION].

_HEADERS: `list[str]` = (source)

Undocumented

Value

    ['content-id', 'content-description', 'content-transfer-encoding']