weboob.capabilities.messages

class weboob.capabilities.messages.Thread(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Thread containing messages.
Variables:
  • root – (Message) Root message
  • title – (unicode) Title of thread
  • date – (date, datetime) Date of thread
  • flags – (int, long) Flags (IS_* constants) (default: 1)
IS_DISCUSSION = 2
IS_THREADS = 1
iter_all_messages()

Iter all messages of the thread.

Return type:iter[Message]
class weboob.capabilities.messages.Message(thread=NotLoaded, id=NotLoaded, title=NotLoaded, sender=NotLoaded, receivers=NotLoaded, date=None, parent=NotLoaded, content=NotLoaded, signature=NotLoaded, children=NotLoaded, flags=0, url=None)

Bases: weboob.capabilities.base.BaseObject

Represents a message read or to send.
Variables:
  • thread – (Thread) Reference to the thread
  • title – (unicode) Title of message
  • sender – (unicode) Author of this message
  • receivers – (list) Receivers of the message
  • date – (date, datetime) Date when the message has been sent
  • content – (unicode) Body of message
  • signature – (unicode) Optional signature
  • parent – (Message) Parent message
  • children – (list) Children fields
  • flags – (int, long) Flags (IS_* constants) (default: 0)
IS_HTML = 1

The content is HTML formatted

IS_NOT_RECEIVED = 8

The receiver hass not read this message

IS_RECEIVED = 4

The receiver has read this message

IS_UNREAD = 2

The message is unread

date_int

Date of message as an integer.

full_id

Full ID of message (in form ‘THREAD_ID.MESSAGE_ID‘)

full_parent_id

Get the full ID of the parent message (in form ‘THREAD_ID.MESSAGE_ID‘).

class weboob.capabilities.messages.CapMessages

Bases: weboob.capabilities.base.Capability

Capability to read messages.

get_thread(id)

Get a specific thread.

Return type:Thread
iter_threads()

Iterates on threads, from newers to olders.

Return type:iter[Thread]
iter_unread_messages()

Iterates on messages which hasn’t been marked as read.

Return type:iter[Message]
set_message_read(message)

Set a message as read.

Parameters:message (Message or str) – message read (or ID)
exception weboob.capabilities.messages.CantSendMessage

Bases: weboob.capabilities.base.UserError

Raised when a message can’t be send.

class weboob.capabilities.messages.CapMessagesPost

Bases: weboob.capabilities.base.Capability

This capability allow user to send a message.

post_message(message)

Post a message.

Parameters:message (Message) – message to send
Raises:CantSendMessage