Many of the external links found in the notmuch source can be resolved
using https instead of http. This changeset addresses as many as i
could find, without touching the e-mail corpus or expected outputs
found in tests.
Currently, http://packages.python.org/notmuch/ goes through a series
of redirections and ends up pointing to readthedocs. Since we're
using readthedocs directly anyway, just point to it directly.
readthedocs are also now sensibly using a separate domain
(readthedocs.io) for their hosted documentation as distinct from their
own domain (readthedocs.org), so use the correct tld.
The notmuch python bindings document that database.remove_message
should raise an exception when the message removal fails, but they
don't actually do it.
Drop unused imports, and avoid warning about unused imports when we
import something on behalf of another module.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Remove the __len__ functions, as they exhaust the iterator, breaking
'list(x)'.
This is a follow-up to 8866a89e.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Use 'notmuch_query_search_{threads,messages}_st' instead of their
deprecated counterpart.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Add support for the new notmuch status codes UNSUPPORTED_OPERATION,
UPGRADE_REQUIRED, and PATH_ERROR.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This gives some additional access to debugging information when using
the python bindings.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Failing to update this string in globals.py causes failures when the
SONAME changes. In order to hopefully reduce the number of such
errors, automate the process of setting the SONAME in the python
bindings.
This should have happened in commit 6754ad9f9, but oops.
This was not caught by our test suite because it uses an installed
notmuch library of it cannot find the just built one.
Also bump the python bindings version, the NEWS version and the Debian
version.
Since the changelog is (slightly dubiously) metadata, we have to
change it to upload a release candidate.
html_static_path is a kind of source directory and it was set to
destination directory (../html) which caused infinite recursion with
Sphinx 1.2 and above.
Roll (one last?) release candidate because of Austin's
LIBNOTMUCH_VERSION changes.
Atomically bump the manually (NEWS, debian/changelog) and
automatically (everywhere else) updated places version is mentioned.
Remove the superfluous mode argument given to notmuch_database_create
fixing the creation of notmuch databases using python code.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Removes Message.{format,print}_messages.
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. The code has been marked as deprecated
in 0.14 and is now removed.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Now that notmuch_database_find_message_by_filename works on read-only
databases, remove the workaround that disabled it on read-write
databases.
This also adds a regression test for find_message_by_filename.
notmuch_database_get_directory no longer returns an error for
read-only databases, so remove ReadOnlyDatabaseError from the list of
get_directory exceptions.
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.15.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
8dc8495010 introduced a bug, if the
requested header is not set the underlying notmuch function returns an
empty string that also made the expression true resulting in an
exception being raised. Partly revert the commit to fix this
issue. Testing for equality with None is correct in this case since
the restype of the function Message._get_header is c_char_p so NULL
pointers are in fact converted to None in this case.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Removes Message.format_message_{internal,as_json,as_text}.
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. The code has been marked as deprecated
in 0.13 and is now removed.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Removes notmuch.py. If someone wants to step up and work on this it
can always be restored using the version control system.
notmuch.py was meant to be a python implementation of the notmuch
utility. It was never finished and hasn't been updated to changes in
the API and bindings and its features and interface haven't been kept
in sync with the notmuch utility.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
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>
Put each libnotmuch function reference right in front of the
corresponding python wrapper.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>