notmuch_database_get_directory no longer returns an error for
read-only databases, so remove ReadOnlyDatabaseError from the list of
get_directory exceptions.
notmuch_database_get_directory now returns
NOTMUCH_STATUS_READ_ONLY_DATABASE on its own (rather than crashing) so
the workaround in Database.get_directory is no longer necessary.
We've changed the APIs of notmuch_database_open,
notmuch_database_create, and notmuch_database_close.
Amended by db: also bump string in bindings/python/notmuch/globals.py
Put a prominent warning into the docstring of Database.close, make the
function show up in the sphinx doc and refer to the warning in the
paragraph mentioning the context manager protocol.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This code adds functionality at the python level that is unlikely to
be useful for anyone. Furthermore the python bindings strive to be a
thin wrapper around libnotmuch, so this code will be removed in
notmuch 0.14.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Cleanup the code, reword the docstring and use the same implementation
in the Threads, Tags and Messages classes.
__nonzero__ implements truth value testing. If __nonzero__ is not
implemented, the python runtime would fall back to `len(..) > 0` thus
exhausting the iterator.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Formerly the documentation was overly verbose. Reword the comment and
use the same for both functions.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Remove the function Filenames.as_generator that has been marked as
deprecated in 0.12.
The class Filenames implements the iterator protocol so you can
directly iterate over such objects instead.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Move each classes documentation into its own file and thus into its
own page in the generated documentation.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Remove the notmuch prefix from classes in the documentation. This
change makes the table of contents look much nicer.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Move the Directory class into its own file, merge the two Filenames
classes into one, deprecate Filenames.as_iterator, update the
documentation accordingly.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Fix the indentation within the docstring, remove useless remarks, do
some trivial refactoring.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Raise specific error classes instead of a generic NotmuchError with an
magic status value (e.g. NotmuchError(STATUS.NULL_POINTER) ->
NullPointerError()), update the documentation accordingly.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>