GMime.Multipart

g GMime.Multipart GMime.Multipart GMime.Object GMime.Object GMime.Object->GMime.Multipart GObject.Object GObject.Object GObject.Object->GMime.Object

Subclasses:

GMime.MultipartEncrypted, GMime.MultipartSigned

Methods

Inherited:

GMime.Object (28), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_with_subtype (subtype)

add (part)

clear ()

contains (part)

foreach (callback, *user_data)

get_boundary ()

get_count ()

get_epilogue ()

get_part (index)

get_prologue ()

get_subpart_from_content_id (content_id)

index_of (part)

insert (index, part)

remove (part)

remove_at (index)

replace (index, replacement)

set_boundary (boundary)

set_epilogue (epilogue)

set_prologue (prologue)

Virtual Methods

Inherited:

GMime.Object (8), GObject.Object (7)

do_add (part)

do_clear ()

do_contains (part)

do_get_boundary ()

do_get_count ()

do_get_part (index)

do_index_of (part)

do_insert (index, part)

do_remove (part)

do_remove_at (index)

do_set_boundary (boundary)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

boundary

str

r

MIME boundary

children

[object]

r

array of MIME sub-parts

epilogue

str

r

multipart epilogue

parent_object

GMime.Object

r

parent GMime.Object

prologue

str

r

multipart prologue

write_end_boundary

bool

r

Class Details

class GMime.Multipart(**kwargs)
Bases:

GMime.Object

Abstract:

No

Structure:

GMime.MultipartClass

A base MIME multipart object.

classmethod new()
Returns:

an empty MIME multipart object with a default content-type of multipart/mixed.

Return type:

GMime.Multipart

Creates a new MIME multipart object with a default content-type of multipart/mixed.

classmethod new_with_subtype(subtype)
Parameters:

subtype (str) – content-type subtype

Returns:

an empty MIME multipart object with a content-type of multipart/subtype.

Return type:

GMime.Multipart

Creates a new MIME multipart object with a content-type of multipart/subtype.

add(part)
Parameters:

part (GMime.Object) – a GMime.Object

Appends a mime part to self.

clear()

Removes all subparts from self.

contains(part)
Parameters:

part (GMime.Object) – a GMime.Object

Returns:

True if part is a subpart of self or False otherwise.

Return type:

bool

Checks if part is contained within self.

foreach(callback, *user_data)
Parameters:

Recursively calls callback on each of self's subparts.

get_boundary()
Returns:

the boundary on the multipart.

Return type:

str

Gets the boundary on the multipart. If the internal boundary is None, then an auto-generated boundary will be set on the multipart and returned.

get_count()
Returns:

the number of parts contained within self.

Return type:

int

Gets the number of parts contained within self.

get_epilogue()
Returns:

a pointer to the epilogue string on the multipart.

Return type:

str

Gets the epilogue on the multipart.

get_part(index)
Parameters:

index (int) – the 0-based index of the part

Returns:

the part at position index.

Return type:

GMime.Object

Gets the part at the specified index within the multipart.

get_prologue()
Returns:

a pointer to the prologue string on the multipart.

Return type:

str

Gets the prologue on the multipart.

get_subpart_from_content_id(content_id)
Parameters:

content_id (str) – the content id of the part to look for

Returns:

the GMime.Object whose content-id matches the search string, or None if a match cannot be found.

Return type:

GMime.Object

Gets the mime part with the content-id content_id from the multipart self.

index_of(part)
Parameters:

part (GMime.Object) – a GMime.Object

Returns:

the 0-based index of part within self or %-1 if not found.

Return type:

int

Gets the 0-based index of part within self.

insert(index, part)
Parameters:

Inserts part into self at the specified index.

remove(part)
Parameters:

part (GMime.Object) – a GMime.Object

Returns:

True if the part was removed or False otherwise.

Return type:

bool

Removes the specified part from self.

remove_at(index)
Parameters:

index (int) – the 0-based index of the part to remove

Returns:

the mime part that was removed or None if the part was not contained within the multipart.

Return type:

GMime.Object

Removes the part at the specified index from self.

replace(index, replacement)
Parameters:
Returns:

the part that was replaced or None if the part was not contained within the multipart.

Return type:

GMime.Object

Replaces the part at the specified index within self with replacement.

set_boundary(boundary)
Parameters:

boundary (str) – boundary or None to autogenerate one

Sets boundary as the boundary on the multipart. If boundary is None, then a boundary will be auto-generated for you.

set_epilogue(epilogue)
Parameters:

epilogue (str) – epilogue

Sets the epilogue on the multipart.

set_prologue(prologue)
Parameters:

prologue (str) – prologue

Sets the prologue on the multipart.

do_add(part) virtual
Parameters:

part (GMime.Object) – a GMime.Object

Appends a mime part to multipart.

do_clear() virtual

Removes all subparts from multipart.

do_contains(part) virtual
Parameters:

part (GMime.Object) – a GMime.Object

Returns:

True if part is a subpart of multipart or False otherwise.

Return type:

bool

Checks if part is contained within multipart.

do_get_boundary() virtual
Returns:

the boundary on the multipart.

Return type:

str

Gets the boundary on the multipart. If the internal boundary is None, then an auto-generated boundary will be set on the multipart and returned.

do_get_count() virtual
Returns:

the number of parts contained within multipart.

Return type:

int

Gets the number of parts contained within multipart.

do_get_part(index) virtual
Parameters:

index (int) – the 0-based index of the part

Returns:

the part at position index.

Return type:

GMime.Object

Gets the part at the specified index within the multipart.

do_index_of(part) virtual
Parameters:

part (GMime.Object) – a GMime.Object

Returns:

the 0-based index of part within multipart or %-1 if not found.

Return type:

int

Gets the 0-based index of part within multipart.

do_insert(index, part) virtual
Parameters:

Inserts part into multipart at the specified index.

do_remove(part) virtual
Parameters:

part (GMime.Object) – a GMime.Object

Returns:

True if the part was removed or False otherwise.

Return type:

bool

Removes the specified part from multipart.

do_remove_at(index) virtual
Parameters:

index (int) – the 0-based index of the part to remove

Returns:

the mime part that was removed or None if the part was not contained within the multipart.

Return type:

GMime.Object

Removes the part at the specified index from multipart.

do_set_boundary(boundary) virtual
Parameters:

boundary (str) – boundary or None to autogenerate one

Sets boundary as the boundary on the multipart. If boundary is None, then a boundary will be auto-generated for you.