GMime.Multipart¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
boundary |
r |
MIME boundary |
|
children |
[ |
r |
array of MIME sub-parts |
epilogue |
r |
multipart epilogue |
|
parent_object |
r |
parent |
|
prologue |
r |
multipart prologue |
|
write_end_boundary |
r |
Class Details¶
- class GMime.Multipart(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A base MIME multipart object.
- classmethod new()¶
- Returns:
an empty MIME multipart object with a default content-type of multipart/mixed.
- Return type:
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:
Creates a new MIME multipart object with a content-type of multipart/subtype.
- add(part)¶
- Parameters:
part (
GMime.Object
) – aGMime.Object
Appends a mime part to self.
- clear()¶
Removes all subparts from self.
- contains(part)¶
- Parameters:
part (
GMime.Object
) – aGMime.Object
- Returns:
- Return type:
Checks if part is contained within self.
- foreach(callback, *user_data)¶
- Parameters:
callback (
GMime.ObjectForeachFunc
) – function to call for each of self's subparts.
Recursively calls callback on each of self's subparts.
- get_boundary()¶
- Returns:
the boundary on the multipart.
- Return type:
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:
Gets the number of parts contained within self.
- get_epilogue()¶
- Returns:
a pointer to the epilogue string on the multipart.
- Return type:
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:
Gets the part at the specified index within the multipart.
- get_prologue()¶
- Returns:
a pointer to the prologue string on the multipart.
- Return type:
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, orNone
if a match cannot be found.- Return type:
Gets the mime part with the content-id content_id from the multipart self.
- index_of(part)¶
- Parameters:
part (
GMime.Object
) – aGMime.Object
- Returns:
the 0-based index of part within self or %-1 if not found.
- Return type:
Gets the 0-based index of part within self.
- insert(index, part)¶
- Parameters:
index (
int
) – the 0-based index to insert the partpart (
GMime.Object
) – aGMime.Object
Inserts part into self at the specified index.
- remove(part)¶
- Parameters:
part (
GMime.Object
) – aGMime.Object
- Returns:
- Return type:
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:
Removes the part at the specified index from self.
- replace(index, replacement)¶
- Parameters:
index (
int
) – the 0-based index of the part to replacereplacement (
GMime.Object
) – aGMime.Object
to use as the replacement
- Returns:
the part that was replaced or
None
if the part was not contained within the multipart.- Return type:
Replaces the part at the specified index within self with replacement.
- set_boundary(boundary)¶
-
Sets boundary as the boundary on the multipart. If boundary is
None
, then a boundary will be auto-generated for you.
- do_add(part) virtual¶
- Parameters:
part (
GMime.Object
) – aGMime.Object
Appends a mime part to multipart.
- do_clear() virtual¶
Removes all subparts from multipart.
- do_contains(part) virtual¶
- Parameters:
part (
GMime.Object
) – aGMime.Object
- Returns:
- Return type:
Checks if part is contained within multipart.
- do_get_boundary() virtual¶
- Returns:
the boundary on the multipart.
- Return type:
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:
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:
Gets the part at the specified index within the multipart.
- do_index_of(part) virtual¶
- Parameters:
part (
GMime.Object
) – aGMime.Object
- Returns:
the 0-based index of part within multipart or %-1 if not found.
- Return type:
Gets the 0-based index of part within multipart.
- do_insert(index, part) virtual¶
- Parameters:
index (
int
) – the 0-based index to insert the partpart (
GMime.Object
) – aGMime.Object
Inserts part into multipart at the specified index.
- do_remove(part) virtual¶
- Parameters:
part (
GMime.Object
) – aGMime.Object
- Returns:
- Return type:
Removes the specified part from multipart.