objects have a strict parent-child relationship and when the parent is
freed all the children are freed as well. This has some implications
for these Python bindings as parent objects need to be kept alive.
-This is normally schielded entirely from the user however and the
+This is normally shielded entirely from the user however and the
Python objects automatically make sure the right references are kept
alive. It is however the reason the :class:`BaseObject` exists as it
defines the API all Python objects need to implement to work
However during some peculiar situations, e.g. interpreter
shutdown, it is possible for the :meth:`__del__` method to have
- been called, whele there are still references to an object. This
+ been called, while there are still references to an object. This
could result in child objects asking their memory to be freed
after the parent has already freed the memory, making things
rather unhappy as double frees are not taken lightly in C. To
:type parent: NotmuchObject
:param iter_p: The CFFI pointer to the C iterator.
:type iter_p: cffi.cdata
- :param fn_destory: The CFFI notmuch_*_destroy function.
+ :param fn_destroy: The CFFI notmuch_*_destroy function.
:param fn_valid: The CFFI notmuch_*_valid function.
:param fn_get: The CFFI notmuch_*_get function.
:param fn_next: The CFFI notmuch_*_move_to_next function.
class ConfigMapping(base.NotmuchObject, collections.abc.MutableMapping):
"""The config key/value pairs loaded from the database, config file,
- and and/or defaults.
+ and/or defaults.
The entries are exposed as a :class:`collections.abc.MutableMapping` object.
Note that setting a value to an empty string is the same as deleting it.
The returned context manager can be used to perform atomic
operations on the database.
- .. note:: Unlinke a traditional RDBMS transaction this does
+ .. note:: Unlike a traditional RDBMS transaction this does
not imply durability, it only ensures the changes are
performed atomically.
:raises XapianError: A Xapian exception occurred.
:raises FileError: The file referred to by ``pathname`` could
not be opened.
- :raises FileNotEmailError: The file referreed to by
+ :raises FileNotEmailError: The file referred to by
``pathname`` is not recognised as an email message.
:raises ReadOnlyDatabaseError: The database is opened in
READ_ONLY mode.
Instead the map has an additional :meth:`PropertiesMap.getall`
method which can be used to retrieve all properties of a given
- key. This method also allows iterating of a a subset of the
+ key. This method also allows iterating of a subset of the
keys starting with a given prefix.
"""
try:
"""A mutable mapping to manage properties.
Both keys and values of properties are supposed to be UTF-8
- strings in libnotmuch. However since the uderlying API uses
+ strings in libnotmuch. However since the underlying API uses
bytestrings you can use either str or bytes to represent keys and
all returned keys and values use :class:`BinString`.
return len(list(it))
def __getitem__(self, key):
- """Return **the first** peroperty associated with a key."""
+ """Return **the first** property associated with a key."""
if isinstance(key, str):
key = key.encode('utf-8')
value_pp = capi.ffi.new('char**')
"""Return a :class:`collections.abc.ItemsView` for this map.
The ItemsView treats a ``(key, value)`` pair as unique, so
- dupcliate ``(key, value)`` pairs will be merged together.
+ duplicate ``(key, value)`` pairs will be merged together.
However duplicate keys with different values will be returned.
"""
items = set()
return PropertiesItemsView(items)
def values(self):
- """Return a :class:`collecions.abc.ValuesView` for this map.
+ """Return a :class:`collections.abc.ValuesView` for this map.
All unique property values are included in the view.
"""
return self.iter(encoding='utf-8', errors='ignore')
def iter(self, *, encoding=None, errors='strict'):
- """Aternate iterator constructor controlling string decoding.
+ """Alternate iterator constructor controlling string decoding.
Tags are stored as bytes in the notmuch database, in Python
it's easier to work with unicode strings and thus is what the
"""
# self._cffi_fn should point either to
# notmuch_database_get_all_tags, notmuch_thread_get_tags or
- # notmuch_message_get_tags. nothmuch.h suggests these never
+ # notmuch_message_get_tags. notmuch.h suggests these never
# fail, let's handle NULL anyway.
tags_p = self._cffi_fn(self._ptr())
if tags_p == capi.ffi.NULL:
Tags are bytestrings and calling ``iter()`` will return an
iterator yielding bytestrings. However the :meth:`iter` method
can be used to return tags as unicode strings, while all other
- operations accept either byestrings or unicode strings. In case
+ operations accept either bytestrings or unicode strings. In case
unicode strings are used they will be encoded using utf-8 before
being passed to notmuch.
"""