GMime.FormatOptions

Fields

None

Methods

class

get_default ()

class

new ()

add_hidden_header (header)

clear_hidden_headers ()

clone ()

create_newline_filter (ensure_newline)

free ()

get_newline ()

get_newline_format ()

get_param_encoding_method ()

is_hidden_header (header)

remove_hidden_header (header)

set_newline_format (newline)

set_param_encoding_method (method)

Details

class GMime.FormatOptions

Format options for serializing various GMime objects.

classmethod get_default()
Returns:

the default format options.

Return type:

GMime.FormatOptions

Gets the default format options.

classmethod new()
Returns:

a newly allocated set of GMime.FormatOptions with the default values.

Return type:

GMime.FormatOptions

Creates a new set of GMime.FormatOptions.

add_hidden_header(header)
Parameters:

header (str) – a header name

Adds the given header to the list of headers that should be hidden.

clear_hidden_headers()

Clears the list of headers that should be hidden.

clone()
Returns:

a newly allocated GMime.FormatOptions.

Return type:

GMime.FormatOptions

Clones a GMime.FormatOptions.

create_newline_filter(ensure_newline)
Parameters:

ensure_newline (bool) – True if the output must *always* end with a new line

Returns:

a GMime.Filter to convert to the specified new-line format.

Return type:

GMime.Filter

Creates a GMime.Filter suitable for converting line-endings to the currently set new-line format.

free()

Frees a set of GMime.FormatOptions.

get_newline()
Returns:

a new-line character sequence.

Return type:

str

Gets a string representing the currently set new-line format.

get_newline_format()
Returns:

the new-line format that is currently set.

Return type:

GMime.NewLineFormat

Gets the new-line format to use when writing out messages and headers.

get_param_encoding_method()
Returns:

the encoding method that is currently set.

Return type:

GMime.ParamEncodingMethod

Gets the parameter encoding method to use for GMime.Param parameters that do not already have an encoding method specified.

is_hidden_header(header)
Parameters:

header (str) – the name of a header

Returns:

True if the header should be hidden or False otherwise.

Return type:

bool

Gets whether or not the specified header should be hidden.

remove_hidden_header(header)
Parameters:

header (str) – a header name

Removes the given header from the list of headers that should be hidden.

set_newline_format(newline)
Parameters:

newline (GMime.NewLineFormat) – a GMime.NewLineFormat

Sets the new-line format that should be used when writing headers and messages.

set_param_encoding_method(method)
Parameters:

method (GMime.ParamEncodingMethod) – a GMime.ParamEncodingMethod

Sets the parameter encoding method to use when encoding parameters which do not have an encoding method specified.

Note: GMime.ParamEncodingMethod.DEFAULT is not allowed.