class documentation

This is the base backend for temporary message storage. This is not a complete class; to be a usable storage backend, it must be subclassed and the two methods ``_get`` and ``_store`` overridden.

Method __contains__ Undocumented
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Method add Queue a message to be stored.
Method update Store all unread messages.
Class Variable level Undocumented
Instance Variable added_new Undocumented
Instance Variable request Undocumented
Instance Variable used Undocumented
Method _get Retrieve a list of stored messages. Return a tuple of the messages and a flag indicating whether or not all the messages originally intended to be stored in this storage were, in fact, stored and retrieved; e...
Method _get_level Return the minimum recorded level.
Method _prepare_messages Prepare a list of messages for storage.
Method _set_level Set a custom minimum recorded level.
Method _store Store a list of messages and return a list of any messages which could not be stored.
Instance Variable _level Undocumented
Instance Variable _queued_messages Undocumented
Property _loaded_messages Return a list of loaded messages, retrieving them first if they have not been loaded yet.
def __contains__(self, item): (source)

Undocumented

def __iter__(self): (source)

Undocumented

def __len__(self): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def add(self, level, message, extra_tags=''): (source)

Queue a message to be stored. The message is only queued if it contained something and its level is not less than the recording level (``self.level``).

def update(self, response): (source)

Store all unread messages. If the backend has yet to be iterated, store previously stored messages again. Otherwise, only store messages added after the last iteration.

Undocumented

added_new: bool = (source)

Undocumented

Undocumented

def _get(self, *args, **kwargs): (source)

Retrieve a list of stored messages. Return a tuple of the messages and a flag indicating whether or not all the messages originally intended to be stored in this storage were, in fact, stored and retrieved; e.g., ``(messages, all_retrieved)``. **This method must be implemented by a subclass.** If it is possible to tell if the backend was not used (as opposed to just containing no messages) then ``None`` should be returned in place of ``messages``.

def _get_level(self): (source)

Return the minimum recorded level. The default level is the ``MESSAGE_LEVEL`` setting. If this is not found, the ``INFO`` level is used.

def _prepare_messages(self, messages): (source)

Prepare a list of messages for storage.

def _set_level(self, value=None): (source)

Set a custom minimum recorded level. If set to ``None``, the default level will be used (see the ``_get_level`` method).

def _store(self, messages, response, *args, **kwargs): (source)

Store a list of messages and return a list of any messages which could not be stored. One type of object must be able to be stored, ``Message``. **This method must be implemented by a subclass.**

Undocumented

_queued_messages: list = (source)

Undocumented

@property
_loaded_messages = (source)

Return a list of loaded messages, retrieving them first if they have not been loaded yet.