X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=bindings%2Fpython-cffi%2Fnotmuch2%2F_thread.py;h=e883f3082b8b9bc5fb086c180e3e910e4e72ccf6;hb=2d895a0119b423b117d10e890c9e0eb5d2a9cdf8;hp=a754749fd09071e1a56dbe558c261a545621c4c6;hpb=e2df30f7a98f91543d0b3561dbb366eb4b3d812c;p=notmuch diff --git a/bindings/python-cffi/notmuch2/_thread.py b/bindings/python-cffi/notmuch2/_thread.py index a754749f..e883f308 100644 --- a/bindings/python-cffi/notmuch2/_thread.py +++ b/bindings/python-cffi/notmuch2/_thread.py @@ -42,7 +42,7 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): def threadid(self): """The thread ID as a :class:`BinString`. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_thread_get_thread_id(self._thread_p) return base.BinString.from_cffi(ret) @@ -50,7 +50,7 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): def __len__(self): """Return the number of messages in the thread. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ return capi.lib.notmuch_thread_get_total_messages(self._thread_p) @@ -59,20 +59,24 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): :returns: An iterator yielding :class:`Message` instances. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ msgs_p = capi.lib.notmuch_thread_get_toplevel_messages(self._thread_p) - return message.MessageIter(self, msgs_p, db=self._db) + return message.MessageIter(self, msgs_p, + db=self._db, + msg_cls=message.OwnedMessage) def __iter__(self): """Return an iterator over all the messages in the thread. :returns: An iterator yielding :class:`Message` instances. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ msgs_p = capi.lib.notmuch_thread_get_messages(self._thread_p) - return message.MessageIter(self, msgs_p, db=self._db) + return message.MessageIter(self, msgs_p, + db=self._db, + msg_cls=message.OwnedMessage) @property def matched(self): @@ -82,7 +86,7 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): which did directly match the search query which this thread originates from. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ return capi.lib.notmuch_thread_get_matched_messages(self._thread_p) @@ -100,7 +104,7 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): :returns: The stringified list of authors. :rtype: BinString - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_thread_get_authors(self._thread_p) return base.BinString.from_cffi(ret) @@ -115,7 +119,7 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): :returns: The thread's subject. :rtype: BinString - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_thread_get_subject(self._thread_p) return base.BinString.from_cffi(ret) @@ -127,7 +131,7 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): The time the first message was sent as an integer number of seconds since the *epoch*, 1 Jan 1970. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ return capi.lib.notmuch_thread_get_oldest_date(self._thread_p) @@ -138,7 +142,7 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): The time the last message was sent as an integer number of seconds since the *epoch*, 1 Jan 1970. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ return capi.lib.notmuch_thread_get_newest_date(self._thread_p) @@ -160,7 +164,7 @@ class Thread(base.NotmuchObject, collections.abc.Iterable): :rtype: ImmutableTagSet - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ try: ref = self._cached_tagset