mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
python: Add bindings for notmuch_thread_get_messages
This commit is contained in:
parent
44fe1f2c16
commit
45b9b55863
1 changed files with 22 additions and 5 deletions
|
@ -128,11 +128,6 @@ class Thread(object):
|
|||
in the thread. It will only iterate over the messages in the thread
|
||||
which are not replies to other messages in the thread.
|
||||
|
||||
To iterate over all messages in the thread, the caller will need to
|
||||
iterate over the result of :meth:`Message.get_replies` for each
|
||||
top-level message (and do that recursively for the resulting
|
||||
messages, etc.).
|
||||
|
||||
:returns: :class:`Messages`
|
||||
:raises: :exc:`NotInitializedError` if query is not initialized
|
||||
:raises: :exc:`NullPointerError` if search_messages failed
|
||||
|
@ -147,6 +142,28 @@ class Thread(object):
|
|||
|
||||
return Messages(msgs_p, self)
|
||||
|
||||
"""notmuch_thread_get_messages"""
|
||||
_get_messages = nmlib.notmuch_thread_get_messages
|
||||
_get_messages.argtypes = [NotmuchThreadP]
|
||||
_get_messages.restype = NotmuchMessagesP
|
||||
|
||||
def get_messages(self):
|
||||
"""Returns a :class:`Messages` iterator for all messages in 'thread'
|
||||
|
||||
:returns: :class:`Messages`
|
||||
:raises: :exc:`NotInitializedError` if query is not initialized
|
||||
:raises: :exc:`NullPointerError` if get_messages failed
|
||||
"""
|
||||
if not self._thread:
|
||||
raise NotInitializedError()
|
||||
|
||||
msgs_p = Thread._get_messages(self._thread)
|
||||
|
||||
if not msgs_p:
|
||||
raise NullPointerError()
|
||||
|
||||
return Messages(msgs_p, self)
|
||||
|
||||
_get_matched_messages = nmlib.notmuch_thread_get_matched_messages
|
||||
_get_matched_messages.argtypes = [NotmuchThreadP]
|
||||
_get_matched_messages.restype = c_int
|
||||
|
|
Loading…
Reference in a new issue