class documentation

class IMAPAsync:

Constructor: IMAPAsync()

View In Hierarchy

Threaded IMAP helper so network fetches don't block the UI.

Method __del__ Destructor to clean up resources.
Method __init__ Initialize the async IMAP helper.
Method close Reset the helper and release the worker thread.
Method fetch_email_by_uid Fetch one email body in the background.
Method fetch_unread_emails Fetch unread email summaries in the background.
Method mark_seen_and_refresh Mark one email seen, then refetch the unread list in one thread.
Property error Return the last error message.
Property is_finished Return whether the fetch has finished.
Property is_running Return whether a fetch is running.
Property result Return the fetch result.
Method _start Run a function in a background thread if idle.
Instance Variable _error Undocumented
Instance Variable _finished Undocumented
Instance Variable _lock Undocumented
Instance Variable _result Undocumented
Instance Variable _running Undocumented
Instance Variable _thread Undocumented
def __del__(self):

Destructor to clean up resources.

def __init__(self):

Initialize the async IMAP helper.

def close(self):

Reset the helper and release the worker thread.

def fetch_email_by_uid(self, from_email, from_pass, uid, mark_seen=False) -> bool:

Fetch one email body in the background.

Parameters
from_email:strThe sender email.
from_pass:strThe sender app password.
uid:strThe message UID.
mark_seen:boolMark the email as seen. Defaults to False.
Returns
boolTrue if the thread was started.
def fetch_unread_emails(self, from_email, from_pass, limit=10) -> bool:

Fetch unread email summaries in the background.

Parameters
from_email:strThe sender email.
from_pass:strThe sender app password.
limit:intMaximum number of emails. Defaults to 10.
Returns
boolTrue if the thread was started.
def mark_seen_and_refresh(self, from_email, from_pass, uid) -> bool:

Mark one email seen, then refetch the unread list in one thread.

Parameters
from_email:strThe sender email.
from_pass:strThe sender app password.
uid:strThe message UID.
Returns
boolTrue if the thread was started.
@property
error: str =

Return the last error message.

@property
is_finished: bool =

Return whether the fetch has finished.

@property
is_running: bool =

Return whether a fetch is running.

@property
result =

Return the fetch result.

def _start(self, func) -> bool:

Run a function in a background thread if idle.

Parameters
func:callableThe function to run.
Returns
boolTrue if the thread was started.
_error: str =

Undocumented

_finished: bool =

Undocumented

_lock =

Undocumented

_result =

Undocumented

_running: bool =

Undocumented

_thread =

Undocumented