unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 613317e0953d5a672fde43f8f3da355b5d28769d 2216 bytes (raw)
name: bindings/python-cffi/notmuch2/__init__.py 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
"""Pythonic API to the notmuch database.

Creating Objects
================

Only the :class:`Database` object is meant to be created by the user.
All other objects should be created from this initial object.  Users
should consider their signatures implementation details.

Errors
======

All errors occuring due to errors from the underlying notmuch database
are subclasses of the :exc:`NotmuchError`.  Due to memory management
it is possible to try and use an object after it has been freed.  In
this case a :exc:`ObjectDestroyedError` will be raised.

Memory Management
=================

Libnotmuch uses a hierarchical memory allocator, this means all
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
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
correctly.

Collections and Containers
==========================

Libnotmuch exposes nearly all collections of things as iterators only.
In these python bindings they have sometimes been exposed as
:class:`collections.abc.Container` instances or subclasses of this
like :class:`collections.abc.Set` or :class:`collections.abc.Mapping`
etc.  This gives a more natural API to work with, e.g. being able to
treat tags as sets.  However it does mean that the
:meth:`__contains__`, :meth:`__len__` and frieds methods on these are
usually more and essentially O(n) rather than O(1) as you might
usually expect from Python containers.
"""

from notmuch2 import _capi
from notmuch2._base import *
from notmuch2._database import *
from notmuch2._errors import *
from notmuch2._message import *
from notmuch2._tags import *
from notmuch2._thread import *


NOTMUCH_TAG_MAX = _capi.lib.NOTMUCH_TAG_MAX
del _capi


# Re-home all the objects to the package.  This leaves __qualname__ intact.
for x in locals().copy().values():
    if hasattr(x, '__module__'):
        x.__module__ = __name__
del x

debug log:

solving 613317e0 ...
found 613317e0 in https://yhetil.org/notmuch.git/

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).