of messages, and a subsequent iteration attempt will raise a
:exc:`NotmuchError` STATUS.NOT_INITIALIZED. If you need to
re-iterate over a list of messages you will need to retrieve a new
of messages, and a subsequent iteration attempt will raise a
:exc:`NotmuchError` STATUS.NOT_INITIALIZED. If you need to
re-iterate over a list of messages you will need to retrieve a new
- Technically, this wraps the underlying *notmuch_message_t* structure.
+ Technically, this wraps the underlying *notmuch_message_t*
+ structure. A user will usually not create these objects themselves
+ but get them as search results.
- As this implements __cmp__() it is possible to compare 2
- :class:`Message`s with::
-
- if msg1 == msg2:
+ As it implements :meth:`__cmp__`, it is possible to compare two
+ :class:`Message`\s using `if msg1 == msg2: ...`.
:param msg_p: A pointer to an internal notmuch_message_t
Structure. If it is `None`, we will raise an :exc:`NotmuchError`
STATUS.NULL_POINTER.
:param msg_p: A pointer to an internal notmuch_message_t
Structure. If it is `None`, we will raise an :exc:`NotmuchError`
STATUS.NULL_POINTER.
:param parent: A 'parent' object is passed which this message is
derived from. We save a reference to it, so we can
automatically delete the parent object once all derived
:param parent: A 'parent' object is passed which this message is
derived from. We save a reference to it, so we can
automatically delete the parent object once all derived
msg['from'] = self.get_header('from')
msg['tags'] = str(self.get_tags())
msg['date'] = date.fromtimestamp(self.get_date())
msg['from'] = self.get_header('from')
msg['tags'] = str(self.get_tags())
msg['date'] = date.fromtimestamp(self.get_date())
- replies = self.get_replies()
- msg['replies'] = len(replies) if replies is not None else 0
- return "%(from)s (%(date)s) (%(tags)s) %(replies)d replies" % (msg)
+ return "%(from)s (%(date)s) (%(tags)s)" % (msg)