From 93cc4b99dff2dea1f4af3b39f1864eb976c37648 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Mon, 23 Dec 2019 16:06:48 -0500 Subject: [PATCH] python/notmuch2: fix typo for "destroyed" Another fix to the docstrings, this time for the English part of the docstrings, not the Python class name. No functional changes here. Signed-off-by: Daniel Kahn Gillmor --- bindings/python-cffi/notmuch2/_database.py | 28 +++++++++++----------- bindings/python-cffi/notmuch2/_errors.py | 2 +- bindings/python-cffi/notmuch2/_message.py | 24 +++++++++---------- bindings/python-cffi/notmuch2/_thread.py | 20 ++++++++-------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py index 7ef4fe17..95f59ca0 100644 --- a/bindings/python-cffi/notmuch2/_database.py +++ b/bindings/python-cffi/notmuch2/_database.py @@ -262,7 +262,7 @@ class Database(base.NotmuchObject): This is returned as a :class:`pathlib.Path` instance. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ try: return self._cache_path @@ -277,7 +277,7 @@ class Database(base.NotmuchObject): This is a positive integer. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ try: return self._cache_version @@ -296,7 +296,7 @@ class Database(base.NotmuchObject): A read-only database will never be upgradable. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_database_needs_upgrade(self._db_p) return bool(ret) @@ -320,7 +320,7 @@ class Database(base.NotmuchObject): not imply durability, it only ensures the changes are performed atomically. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ctx = AtomicContext(self, '_db_p') return ctx @@ -330,7 +330,7 @@ class Database(base.NotmuchObject): Returned as a ``(revision, uuid)`` namedtuple. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ raw_uuid = capi.ffi.new('char**') rev = capi.lib.notmuch_database_get_revision(self._db_p, raw_uuid) @@ -387,7 +387,7 @@ class Database(base.NotmuchObject): READ_ONLY mode. :raises UpgradeRequiredError: The database must be upgraded first. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path): filename = bytes(filename) @@ -426,7 +426,7 @@ class Database(base.NotmuchObject): READ_ONLY mode. :raises UpgradeRequiredError: The database must be upgraded first. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path): filename = bytes(filename) @@ -458,7 +458,7 @@ class Database(base.NotmuchObject): :raises OutOfMemoryError: When there is no memory to allocate the message instance. :raises XapianError: A Xapian exception ocurred. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ msg_pp = capi.ffi.new('notmuch_message_t **') ret = capi.lib.notmuch_database_find_message(self._db_p, @@ -489,7 +489,7 @@ class Database(base.NotmuchObject): :raises OutOfMemoryError: When there is no memory to allocate the message instance. :raises XapianError: A Xapian exception ocurred. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path): filename = bytes(filename) @@ -522,7 +522,7 @@ class Database(base.NotmuchObject): :rtype: ImmutableTagSet - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ try: ref = self._cached_tagset @@ -570,7 +570,7 @@ class Database(base.NotmuchObject): :raises OutOfMemoryError: if no memory is available to allocate the query. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ query = self._create_query(query, omit_excluded=omit_excluded, @@ -587,7 +587,7 @@ class Database(base.NotmuchObject): :returns: An iterator over the messages found. :rtype: MessageIter - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ query = self._create_query(query, omit_excluded=omit_excluded, @@ -635,7 +635,7 @@ class AtomicContext: section is not active. When it is raised at exit time the atomic section is still active and you may need to try using :meth:`force_end`. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ def __init__(self, db, ptr_name): @@ -675,7 +675,7 @@ class AtomicContext: not ended. :raises UnbalancedAtomicError: If the database was currently not in an atomic section. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_database_end_atomic(self._ptr()) if ret != capi.lib.NOTMUCH_STATUS_SUCCESS: diff --git a/bindings/python-cffi/notmuch2/_errors.py b/bindings/python-cffi/notmuch2/_errors.py index 1c88763b..13369445 100644 --- a/bindings/python-cffi/notmuch2/_errors.py +++ b/bindings/python-cffi/notmuch2/_errors.py @@ -97,7 +97,7 @@ class IllegalArgumentError(NotmuchError): pass class ObjectDestroyedError(NotmuchError): - """The object has already been destoryed and it's memory freed. + """The object has already been destroyed and it's memory freed. This occurs when :meth:`destroy` has been called on the object but you still happen to have access to the object. This should not diff --git a/bindings/python-cffi/notmuch2/_message.py b/bindings/python-cffi/notmuch2/_message.py index bb561426..c5fdbf6d 100644 --- a/bindings/python-cffi/notmuch2/_message.py +++ b/bindings/python-cffi/notmuch2/_message.py @@ -98,7 +98,7 @@ class Message(base.NotmuchObject): bytes() on it will return the original bytes used to create it. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_message_get_message_id(self._msg_p) return base.BinString(capi.ffi.string(ret)) @@ -116,7 +116,7 @@ class Message(base.NotmuchObject): bytes() on it will return the original bytes used to create it. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_message_get_thread_id(self._msg_p) return base.BinString(capi.ffi.string(ret)) @@ -128,7 +128,7 @@ class Message(base.NotmuchObject): If multiple files in the database contain the same message ID this will be just one of the files, chosen at random. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_message_get_filename(self._msg_p) return pathlib.Path(os.fsdecode(capi.ffi.string(ret))) @@ -140,7 +140,7 @@ class Message(base.NotmuchObject): See :attr:`path` for details, this is the same but does return the path as a bytes object which is faster but less convenient. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_message_get_filename(self._msg_p) return capi.ffi.string(ret) @@ -155,7 +155,7 @@ class Message(base.NotmuchObject): :returns: Iterator yielding :class:`pathlib.Path` instances. :rtype: iter - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ fnames_p = capi.lib.notmuch_message_get_filenames(self._msg_p) return PathIter(self, fnames_p) @@ -169,7 +169,7 @@ class Message(base.NotmuchObject): :returns: Iterator yielding :class:`bytes` instances. :rtype: iter - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ fnames_p = capi.lib.notmuch_message_get_filenames(self._msg_p) return FilenamesIter(self, fnames_p) @@ -184,7 +184,7 @@ class Message(base.NotmuchObject): :attr:`messageid` and :attr:`threadid` attributes are valid for it. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_message_get_flag( self._msg_p, capi.lib.NOTMUCH_MESSAGE_FLAG_GHOST) @@ -201,7 +201,7 @@ class Message(base.NotmuchObject): these messages to be flagged, which results in this property being set to *True*. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_message_get_flag( self._msg_p, capi.lib.NOTMUCH_MESSAGE_FLAG_EXCLUDED) @@ -216,7 +216,7 @@ class Message(base.NotmuchObject): message's header, you can get the original header value with :meth:`header`. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ return capi.lib.notmuch_message_get_date(self._msg_p) @@ -240,7 +240,7 @@ class Message(base.NotmuchObject): :raises LookupError: if the header is not present. :raises NullPointerError: For unexpected notmuch errors. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ # The returned is supposedly guaranteed to be UTF-8. Header # names must be ASCII as per RFC x822. @@ -263,7 +263,7 @@ class Message(base.NotmuchObject): :raises ReadOnlyDatabaseError: When manipulating tags on a database opened in read-only mode. - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ try: ref = self._cached_tagset @@ -297,7 +297,7 @@ class Message(base.NotmuchObject): :raises UnbalancedFreezeThawError: if you somehow managed to call __exit__ of this context manager more than once. Why did you do that? - :raises ObjectDestroyedError: if used after destoryed. + :raises ObjectDestroyedError: if used after destroyed. """ ret = capi.lib.notmuch_message_freeze(self._msg_p) if ret != capi.lib.NOTMUCH_STATUS_SUCCESS: diff --git a/bindings/python-cffi/notmuch2/_thread.py b/bindings/python-cffi/notmuch2/_thread.py index a754749f..bb76f2dc 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,7 +59,7 @@ 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) @@ -69,7 +69,7 @@ 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_messages(self._thread_p) return message.MessageIter(self, msgs_p, db=self._db) @@ -82,7 +82,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 +100,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 +115,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 +127,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 +138,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 +160,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