GMime.Header¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
changed |
r |
||
charset |
r |
||
formatter |
r |
||
name |
r |
the name of the header |
|
offset |
r |
||
options |
r |
||
parent_object |
r |
||
raw_name |
r |
||
raw_value |
r |
||
reformat |
r |
||
value |
r |
the unfolded value of the header |
Class Details¶
- class GMime.Header(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A message or mime-part header.
- format_addrlist(options, value, charset)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
value (
str
) – a Sender, From, Reply-To, To, Cc, or Bcc header valuecharset (
str
) – a charset (note: unused)
- Returns:
a newly allocated string containing the reformatted value.
- Return type:
Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.
- format_content_disposition(options, value, charset)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
value (
str
) – a Content-Disposition header valuecharset (
str
) – a charset (note: unused)
- Returns:
a newly allocated string containing the reformatted value.
- Return type:
Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.
- format_content_type(options, value, charset)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
value (
str
) – a Content-Type header valuecharset (
str
) – a charset (note: unused)
- Returns:
a newly allocated string containing the reformatted value.
- Return type:
Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.
- format_default(options, value, charset)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
value (
str
) – a header valuecharset (
str
) – a charset to use when encoding the value
- Returns:
a newly allocated string containing the reformatted value.
- Return type:
Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.
- format_message_id(options, value, charset)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
value (
str
) – a Message-Id or Content-Id header valuecharset (
str
) – a charset (note: unused)
- Returns:
a newly allocated string containing the reformatted value.
- Return type:
Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.
- format_received(options, value, charset)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
value (
str
) – a Received header valuecharset (
str
) – a charset (note: unused)
- Returns:
a newly allocated string containing the reformatted value.
- Return type:
Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.
- format_references(options, value, charset)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
value (
str
) – a References or In-Reply-To header valuecharset (
str
) – a charset (note: unused)
- Returns:
a newly allocated string containing the reformatted value.
- Return type:
Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.
- get_offset()¶
- Returns:
the header offset or %-1 if unknown.
- Return type:
Gets the header’s stream offset if known.
- get_raw_name()¶
- Returns:
the raw header name.
- Return type:
Gets the header’s raw name. The raw header name is the complete string up to (but not including) the ‘:’ separating the header’s name from its value. This string may be different from the value returned by
GMime.Header.get_name
() if the parsed message’s header contained trailing whitespace after the header name, such as: “Subject : this is the subject\r\n”.
- get_raw_value()¶
-
Gets the header’s raw (folded) value.
- get_value()¶
-
Gets the header’s unfolded value.
- set_value(options, value, charset)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
value (
str
) – the new header value
Sets the header’s decoded value.
- write_to_stream(options, stream)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
stream (
GMime.Stream
) – aGMime.Stream
- Returns:
the number of bytes written, or %-1 on fail.
- Return type:
Write the header to the specified stream.