GMime.PartIter

Fields

None

Methods

class

new (toplevel)

clone ()

free ()

get_current ()

get_parent ()

get_path ()

get_toplevel ()

is_valid ()

jump_to (path)

next ()

prev ()

remove ()

replace (replacement)

reset ()

Details

class GMime.PartIter

A MIME part iterator.

classmethod new(toplevel)
Parameters:

toplevel (GMime.Object) – a GMime.Object to use as the toplevel

Returns:

a newly allocated GMime.PartIter which should be freed using GMime.PartIter.free() when finished with it.

Return type:

GMime.PartIter

Creates a new GMime.PartIter for iterating over toplevel's subparts.

clone()
Returns:

a new GMime.PartIter that is identical to self.

Return type:

GMime.PartIter

Clones the self, including its current state.

free()

Frees the memory allocated by GMime.PartIter.new().

get_current()
Returns:

the current GMime.Object or None if the state of self is invalid.

Return type:

GMime.Object

Gets the GMime.Object at the current GMime.PartIter position.

get_parent()
Returns:

the parent GMime.Object or None if the state of self is invalid.

Return type:

GMime.Object

Gets the parent of the GMime.Object at the current GMime.PartIter position.

get_path()
Returns:

a newly allocated string representation of the path to the GMime.Object at the current GMime.PartIter position.

Return type:

str

Gets the path of the current GMime.Object in the MIME structure used to initialize self.

get_toplevel()
Returns:

the toplevel GMime.Object.

Return type:

GMime.Object

Gets the toplevel GMime.Object used to initialize self.

is_valid()
Returns:

True if self is valid or False otherwise.

Return type:

bool

Checks that the current state of self is valid.

jump_to(path)
Parameters:

path (str) – a string representing the path to jump to

Returns:

True if the GMime.Object specified by path exists or False otherwise.

Return type:

bool

Updates the state of self to point to the GMime.Object specified by path.

next()
Returns:

True if successful or False otherwise.

Return type:

bool

Advances to the next part in the MIME structure used to initialize self.

prev()
Returns:

True if successful or False otherwise.

Return type:

bool

Rewinds to the previous part in the MIME structure used to initialize self.

remove()
Returns:

True if the part at the current position was removed or False otherwise.

Return type:

bool

Removes the GMime.Object at the current position from its parent. If successful, self is advanced to the next position (since the current position will become invalid).

replace(replacement)
Parameters:

replacement (GMime.Object) – a GMime.Object

Returns:

True if the part at the current position was replaced or False otherwise.

Return type:

bool

Replaces the GMime.Object at the current position with replacement.

reset()

Resets the state of self to its initial state.