Camel.FilterDriver¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class Camel.FilterDriver(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(session)¶
- Parameters:
session (
Camel.Session) –- Returns:
A new
Camel.FilterDriverobject- Return type:
- add_rule(name, match, action)¶
- Parameters:
name (
str) – name of the rulematch (
str) – a code (Camel.SExp) to execute to check whether the rule can be appliedaction (
str) – an action code (Camel.SExp) to execute, when the match evaluates toTrue
Adds a new rule to set of rules to process by the filter driver.
- filter_folder(folder, cache, uids, remove, cancellable)¶
- Parameters:
folder (
Camel.Folder) –Camel.Folderto be filteredcache (
Camel.UIDCache) – UID cache (needed for POP folders)uids ([
str] orNone) – message uids to be filtered orNone(as a shortcut to filter all messages)cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
-1 if errors were encountered during filtering, otherwise returns 0.
- Return type:
Filters a folder based on rules defined in the FilterDriver object.
- filter_mbox(mbox, original_source_url, cancellable)¶
- Parameters:
mbox (
str) – mbox filename to be filteredoriginal_source_url (
strorNone) – URI of the mbox, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
-1 if errors were encountered during filtering, otherwise returns 0.
- Return type:
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:
message (
Camel.MimeMessageorNone) – message to filter orNoneinfo (
Camel.MessageInfoorNone) – message info orNonesource (
Camel.FolderorNone) – source folder orNoneoriginal_store_uid (
strorNone) – UID of source store (pre-movemail), orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
-1 if errors were encountered during filtering, otherwise returns 0.
- Return type:
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 defaultCamel.Folder.append_message() function).
- flush()¶
- Raises:
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:
Removes a rule by name, added by
Camel.FilterDriver.add_rule().
- set_default_folder(def_)¶
- Parameters:
def (
Camel.FolderorNone) – a defaultCamel.Folder
Sets a default folder for the driver. The function adds its own reference for the folder.
- set_logfile(logfile)¶
-
Sets a log file to use for logging.
- set_play_sound_func(func, *user_data)¶
- Parameters:
func (
Camel.FilterPlaySoundFunc) – a callback to play a sound
Sets a callback to call when a play of a sound is requested.
- set_shell_func(func, *user_data)¶
- Parameters:
func (
Camel.FilterShellFunc) – a shell command callback
Sets a shell command callback, which is called when a shell command execution is requested.
- set_status_func(func, *user_data)¶
- Parameters:
func (
Camel.FilterStatusFunc) – a callback to report progress
Sets a status callback, which is used to report progress/status.
- set_system_beep_func(func, *user_data)¶
- Parameters:
func (
Camel.FilterSystemBeepFunc) – a system beep callback
Sets a callback to use for system beep.