GMime.ContentDisposition

g GMime.ContentDisposition GMime.ContentDisposition GObject.Object GObject.Object GObject.Object->GMime.ContentDisposition

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

parse (options, str)

encode (options)

get_disposition ()

get_parameter (name)

get_parameters ()

is_attachment ()

set_disposition (value)

set_parameter (name, value)

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

disposition

str

r

disposition

params

GMime.ParamList

r

a GMime.Param list

parent_object

GObject.Object

r

parent GObject.Object

Class Details

class GMime.ContentDisposition(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GMime.ContentDispositionClass

A data structure representing a Content-Disposition.

classmethod new()
Returns:

a new GMime.ContentDisposition object.

Return type:

GMime.ContentDisposition

Creates a new GMime.ContentDisposition object.

classmethod parse(options, str)
Parameters:
Returns:

a new GMime.ContentDisposition object.

Return type:

GMime.ContentDisposition

Parses the input string into a GMime.ContentDisposition object.

encode(options)
Parameters:

options (GMime.FormatOptions or None) – a GMime.FormatOptions or None

Returns:

a new string containing the encoded header value.

Return type:

str

Encodes the Content-Disposition header.

get_disposition()
Returns:

the disposition string which is probably one of GMime.DISPOSITION_ATTACHMENT or GMime.DISPOSITION_INLINE.

Return type:

str

Gets the disposition or None on fail.

get_parameter(name)
Parameters:

name (str) – parameter name

Returns:

the value of the requested parameter or None if the parameter is not set. If the parameter is set, the returned string will be in UTF-8.

Return type:

str

Gets the parameter value specified by name if it’s available.

get_parameters()
Returns:

the Content-Disposition’s parameter list.

Return type:

GMime.ParamList

Gets the Content-Disposition parameter list.

is_attachment()
Returns:

True if the value matches “attachment”, otherwise False.

Return type:

bool

Determines if a Content-Disposition has a value of “attachment”.

set_disposition(value)
Parameters:

value (str) – disposition value

Sets the disposition to value which may be one of GMime.DISPOSITION_ATTACHMENT or GMime.DISPOSITION_INLINE or, by your choice, any other string which would indicate how the MIME part should be displayed by the MUA.

set_parameter(name, value)
Parameters:
  • name (str) – parameter name

  • value (str) – parameter value

Sets a parameter on the Content-Disposition.

Note: The name should be in US-ASCII while the value should be in UTF-8.