GMime.Header

g GMime.Header GMime.Header GObject.Object GObject.Object GObject.Object->GMime.Header

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

format_addrlist (options, value, charset)

format_content_disposition (options, value, charset)

format_content_type (options, value, charset)

format_default (options, value, charset)

format_message_id (options, value, charset)

format_received (options, value, charset)

format_references (options, value, charset)

get_name ()

get_offset ()

get_raw_name ()

get_raw_value ()

get_value ()

set_raw_value (raw_value)

set_value (options, value, charset)

write_to_stream (options, stream)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

changed

object

r

charset

str

r

formatter

GMime.HeaderRawValueFormatter

r

name

str

r

the name of the header

offset

int

r

options

GMime.ParserOptions

r

parent_object

GObject.Object

r

raw_name

str

r

raw_value

str

r

reformat

bool

r

value

str

r

the unfolded value of the header

Class Details

class GMime.Header(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GMime.HeaderClass

A message or mime-part header.

format_addrlist(options, value, charset)
Parameters:
Returns:

a newly allocated string containing the reformatted value.

Return type:

str

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:
Returns:

a newly allocated string containing the reformatted value.

Return type:

str

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:
Returns:

a newly allocated string containing the reformatted value.

Return type:

str

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:
Returns:

a newly allocated string containing the reformatted value.

Return type:

str

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:
Returns:

a newly allocated string containing the reformatted value.

Return type:

str

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:
Returns:

a newly allocated string containing the reformatted value.

Return type:

str

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:
Returns:

a newly allocated string containing the reformatted value.

Return type:

str

Parses the value and then re-formats it to conform to the formatting options, folding the value if necessary.

get_name()
Returns:

the header name or None if invalid.

Return type:

str

Gets the header’s name.

get_offset()
Returns:

the header offset or %-1 if unknown.

Return type:

int

Gets the header’s stream offset if known.

get_raw_name()
Returns:

the raw header name.

Return type:

str

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()
Returns:

the header value or None if invalid.

Return type:

str

Gets the header’s raw (folded) value.

get_value()
Returns:

the header’s decoded value or None if invalid.

Return type:

str

Gets the header’s unfolded value.

set_raw_value(raw_value)
Parameters:

raw_value (str) – the raw value

Sets the header’s raw value.

set_value(options, value, charset)
Parameters:

Sets the header’s decoded value.

write_to_stream(options, stream)
Parameters:
Returns:

the number of bytes written, or %-1 on fail.

Return type:

int

Write the header to the specified stream.