Camel.FilterDriver

g Camel.FilterDriver Camel.FilterDriver GObject.Object GObject.Object GObject.Object->Camel.FilterDriver

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (session)

add_rule (name, match, action)

filter_folder (folder, cache, uids, remove, cancellable)

filter_mbox (mbox, original_source_url, cancellable)

filter_message (message, info, uid, source, store_uid, original_store_uid, cancellable)

flush ()

remove_rule_by_name (name)

set_default_folder (def_)

set_logfile (logfile)

set_play_sound_func (func, *user_data)

set_shell_func (func, *user_data)

set_status_func (func, *user_data)

set_system_beep_func (func, *user_data)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Camel.FilterDriver(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Camel.FilterDriverClass

classmethod new(session)
Parameters:

session (Camel.Session) –

Returns:

A new Camel.FilterDriver object

Return type:

Camel.FilterDriver

add_rule(name, match, action)
Parameters:
  • name (str) – name of the rule

  • match (str) – a code (Camel.SExp) to execute to check whether the rule can be applied

  • action (str) – an action code (Camel.SExp) to execute, when the match evaluates to True

Adds a new rule to set of rules to process by the filter driver.

filter_folder(folder, cache, uids, remove, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

-1 if errors were encountered during filtering, otherwise returns 0.

Return type:

int

Filters a folder based on rules defined in the FilterDriver object.

filter_mbox(mbox, original_source_url, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

-1 if errors were encountered during filtering, otherwise returns 0.

Return type:

int

Filters an mbox file based on rules defined in the FilterDriver object. Is more efficient as it doesn’t need to open the folder through Camel directly.

filter_message(message, info, uid, source, store_uid, original_store_uid, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

-1 if errors were encountered during filtering, otherwise returns 0.

Return type:

int

Filters a message based on rules defined in the FilterDriver object. If the source folder (source) and the uid (uid) are provided, the filter will operate on the Camel.Folder (which in certain cases is more efficient than using the default Camel.Folder.append_message() function).

flush()
Raises:

GLib.Error

Flush all of the only-once filter actions.

remove_rule_by_name(name)
Parameters:

name (str) – rule name

Returns:

Whether the rule had been found and removed.

Return type:

bool

Removes a rule by name, added by Camel.FilterDriver.add_rule().

set_default_folder(def_)
Parameters:

def (Camel.Folder or None) – a default Camel.Folder

Sets a default folder for the driver. The function adds its own reference for the folder.

set_logfile(logfile)
Parameters:

logfile (object or None) – a FILE handle where to write logging

Sets a log file to use for logging.

set_play_sound_func(func, *user_data)
Parameters:

Sets a callback to call when a play of a sound is requested.

set_shell_func(func, *user_data)
Parameters:

Sets a shell command callback, which is called when a shell command execution is requested.

set_status_func(func, *user_data)
Parameters:

Sets a status callback, which is used to report progress/status.

set_system_beep_func(func, *user_data)
Parameters:

Sets a callback to use for system beep.