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 <dkg@fifthhorseman.net>
This is returned as a :class:`pathlib.Path` instance.
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
"""
try:
return self._cache_path
This is a positive integer.
This is a positive integer.
- :raises ObjectDestroyedError: if used after destoryed.
+ :raises ObjectDestroyedError: if used after destroyed.
"""
try:
return self._cache_version
"""
try:
return self._cache_version
A read-only database will never be upgradable.
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)
"""
ret = capi.lib.notmuch_database_needs_upgrade(self._db_p)
return bool(ret)
not imply durability, it only ensures the changes are
performed atomically.
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
"""
ctx = AtomicContext(self, '_db_p')
return ctx
Returned as a ``(revision, uuid)`` namedtuple.
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)
"""
raw_uuid = capi.ffi.new('char**')
rev = capi.lib.notmuch_database_get_revision(self._db_p, raw_uuid)
READ_ONLY mode.
:raises UpgradeRequiredError: The database must be upgraded
first.
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)
"""
if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path):
filename = bytes(filename)
READ_ONLY mode.
:raises UpgradeRequiredError: The database must be upgraded
first.
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)
"""
if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path):
filename = bytes(filename)
:raises OutOfMemoryError: When there is no memory to allocate
the message instance.
:raises XapianError: A Xapian exception ocurred.
: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,
"""
msg_pp = capi.ffi.new('notmuch_message_t **')
ret = capi.lib.notmuch_database_find_message(self._db_p,
:raises OutOfMemoryError: When there is no memory to allocate
the message instance.
:raises XapianError: A Xapian exception ocurred.
: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)
"""
if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path):
filename = bytes(filename)
- :raises ObjectDestroyedError: if used after destoryed.
+ :raises ObjectDestroyedError: if used after destroyed.
"""
try:
ref = self._cached_tagset
"""
try:
ref = self._cached_tagset
:raises OutOfMemoryError: if no memory is available to
allocate the query.
: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,
"""
query = self._create_query(query,
omit_excluded=omit_excluded,
:returns: An iterator over the messages found.
:rtype: MessageIter
: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,
"""
query = self._create_query(query,
omit_excluded=omit_excluded,
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`.
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):
"""
def __init__(self, db, ptr_name):
not ended.
:raises UnbalancedAtomicError: If the database was currently
not in an atomic section.
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:
"""
ret = capi.lib.notmuch_database_end_atomic(self._ptr())
if ret != capi.lib.NOTMUCH_STATUS_SUCCESS:
class ObjectDestroyedError(NotmuchError):
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
This occurs when :meth:`destroy` has been called on the object but
you still happen to have access to the object. This should not
bytes() on it will return the original bytes used to create
it.
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))
"""
ret = capi.lib.notmuch_message_get_message_id(self._msg_p)
return base.BinString(capi.ffi.string(ret))
bytes() on it will return the original bytes used to create
it.
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))
"""
ret = capi.lib.notmuch_message_get_thread_id(self._msg_p)
return base.BinString(capi.ffi.string(ret))
If multiple files in the database contain the same message ID
this will be just one of the files, chosen at random.
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)))
"""
ret = capi.lib.notmuch_message_get_filename(self._msg_p)
return pathlib.Path(os.fsdecode(capi.ffi.string(ret)))
See :attr:`path` for details, this is the same but does return
the path as a bytes object which is faster but less convenient.
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)
"""
ret = capi.lib.notmuch_message_get_filename(self._msg_p)
return capi.ffi.string(ret)
:returns: Iterator yielding :class:`pathlib.Path` instances.
:rtype: iter
: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)
"""
fnames_p = capi.lib.notmuch_message_get_filenames(self._msg_p)
return PathIter(self, fnames_p)
:returns: Iterator yielding :class:`bytes` instances.
:rtype: iter
: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)
"""
fnames_p = capi.lib.notmuch_message_get_filenames(self._msg_p)
return FilenamesIter(self, fnames_p)
:attr:`messageid` and :attr:`threadid` attributes are valid
for it.
: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)
"""
ret = capi.lib.notmuch_message_get_flag(
self._msg_p, capi.lib.NOTMUCH_MESSAGE_FLAG_GHOST)
these messages to be flagged, which results in this property
being set to *True*.
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)
"""
ret = capi.lib.notmuch_message_get_flag(
self._msg_p, capi.lib.NOTMUCH_MESSAGE_FLAG_EXCLUDED)
message's header, you can get the original header value with
:meth:`header`.
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)
"""
return capi.lib.notmuch_message_get_date(self._msg_p)
:raises LookupError: if the header is not present.
:raises NullPointerError: For unexpected notmuch errors.
: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.
"""
# The returned is supposedly guaranteed to be UTF-8. Header
# names must be ASCII as per RFC x822.
:raises ReadOnlyDatabaseError: When manipulating tags on a
database opened in read-only mode.
: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
"""
try:
ref = self._cached_tagset
:raises UnbalancedFreezeThawError: if you somehow managed to
call __exit__ of this context manager more than once. Why
did you do that?
: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:
"""
ret = capi.lib.notmuch_message_freeze(self._msg_p)
if ret != capi.lib.NOTMUCH_STATUS_SUCCESS:
def threadid(self):
"""The thread ID as a :class:`BinString`.
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)
"""
ret = capi.lib.notmuch_thread_get_thread_id(self._thread_p)
return base.BinString.from_cffi(ret)
def __len__(self):
"""Return the number of messages in the thread.
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)
"""
return capi.lib.notmuch_thread_get_total_messages(self._thread_p)
:returns: An iterator yielding :class:`Message` instances.
: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)
"""
msgs_p = capi.lib.notmuch_thread_get_toplevel_messages(self._thread_p)
return message.MessageIter(self, msgs_p, db=self._db)
:returns: An iterator yielding :class:`Message` instances.
: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)
"""
msgs_p = capi.lib.notmuch_thread_get_messages(self._thread_p)
return message.MessageIter(self, msgs_p, db=self._db)
which did directly match the search query which this thread
originates from.
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)
"""
return capi.lib.notmuch_thread_get_matched_messages(self._thread_p)
:returns: The stringified list of authors.
:rtype: BinString
: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)
"""
ret = capi.lib.notmuch_thread_get_authors(self._thread_p)
return base.BinString.from_cffi(ret)
:returns: The thread's subject.
:rtype: BinString
: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)
"""
ret = capi.lib.notmuch_thread_get_subject(self._thread_p)
return base.BinString.from_cffi(ret)
The time the first message was sent as an integer number of
seconds since the *epoch*, 1 Jan 1970.
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)
"""
return capi.lib.notmuch_thread_get_oldest_date(self._thread_p)
The time the last message was sent as an integer number of
seconds since the *epoch*, 1 Jan 1970.
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)
"""
return capi.lib.notmuch_thread_get_newest_date(self._thread_p)
- :raises ObjectDestroyedError: if used after destoryed.
+ :raises ObjectDestroyedError: if used after destroyed.
"""
try:
ref = self._cached_tagset
"""
try:
ref = self._cached_tagset