Commit graph

37 commits

Author SHA1 Message Date
Ruben Pollan
5e05f00fe5 python: add bindings for notmuch_message_get_propert(y/ies)
Message.get_property (prop) returns a string with the value of the property and
Message.get_properties (prop, exact=False) yields key, value pairs
2018-05-02 20:16:11 -03:00
Georg Faerber
c117306f2d Fix typos as found by codespell
Signed-off-by: Georg Faerber <georg@riseup.net>
2018-03-24 20:09:54 -03:00
l-m-h@web.de
e0ac149955 python: Fix method name in docs
Fix a method rename in the docs that was overlooked in
3444c731d2.
2017-12-24 09:17:06 -04:00
l-m-h@web.de
6c6b0f13ff python: add bindings to access config
The C functions notmuch_database_get_config,
notmuch_database_get_config_list and notmuch_database_set_config are
part of the official C bindings.  So there should also be some python
bindings for them.

Also they are the only way to access the named queries introduced in
b9bf3f44.

The interface of the python functions is designed to be close to the C
functions.
2017-12-19 06:36:30 -04:00
Daniel Kahn Gillmor
b10ce6bc23 database: add n_d_index_file (deprecates n_d_add_message)
We need a way to pass parameters to the indexing functionality on the
first index, not just on reindexing.  The obvious place is in
notmuch_database_add_message.  But since modifying the argument list
would break both API and ABI, we needed a new name.

I considered notmuch_database_add_message_with_params(), but the
functionality we're talking about doesn't always add a message.  It
tries to index a specific file, possibly adding a message, but
possibly doing other things, like adding terms to an existing message,
or failing to deal with message objects entirely (e.g. because the
file didn't contain a message).

So i chose the function name notmuch_database_index_file.

I confess i'm a little concerned about confusing future notmuch
developers with the new name, since we already have a private
_notmuch_message_index_file function, and the two do rather different
things.  But i think the added clarity for people linking against the
future libnotmuch and the capacity for using index parameters makes
this a worthwhile tradeoff.  (that said, if anyone has another name
that they strongly prefer, i'd be happy to go with it)

This changeset also adjusts the tests so that we test whether the new,
preferred function returns bad values (since the deprecated function
just calls the new one).

We can keep the deprecated n_d_add_message function around as long as
we like, but at the next place where we're forced to break API or ABI
we can probably choose to drop the name relatively safely.

NOTE: there is probably more cleanup to do in the ruby and go bindings
to complete the deprecation directly.  I don't know those languages
well enough to attempt a fix; i don't know how to test them; and i
don't know the culture around those languages about API additions or
deprecations.
2017-08-23 07:38:37 -03:00
Daniel Kahn Gillmor
87bdfbc91f Fix orthography 2017-07-18 06:50:44 -03:00
Daniel Kahn Gillmor
6a833a6e83 Use https instead of http where possible
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.
2016-06-05 08:32:17 -03:00
Justus Winter
096c600b96 python: Remove {Filenames,Threads}.__len__
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>
2016-01-08 13:58:33 +01:00
Justus Winter
9ed1eea8b6 python: add new errors
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>
2016-01-08 13:58:33 +01:00
Thibaut Horel
e13d557bfd python: Add binding for notmuch_query_add_tag_exclude
Implemented as the method `exclude_tag` of the class `Query`. This method takes
one argument, a string containing the name of the tag to exclude.
2014-09-23 18:23:39 +02:00
Amadeusz Żołnowski
175144f6ad Unset html_static_path in Python bindings docs
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.
2014-05-28 09:46:02 -03:00
Justus Winter
8728340644 python: remove Database.db_p
The function has been marked as deprecated in 0.14 and is now removed.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-12-21 10:56:06 +01:00
Justus Winter
643719dfce python: remove the "notmuch binary" section from the docs
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-05-17 17:47:49 +02:00
Justus Winter
b9d1045474 python: remove format_message_as_{json,text} from the sphinx docs
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-05-16 16:57:45 +02:00
Justus Winter
ca1e232e5f python: document the Database.close function
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>
2012-04-30 19:48:45 +02:00
Justus Winter
60e512d84f python: fix the documentation
Remove the reference to Filenames.as_generator in the sphinx
documentation.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-04-30 18:32:32 +02:00
Justus Winter
d50171d1cc python: split the documentation
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>
2012-02-24 01:55:33 +01:00
Justus Winter
594dbb6243 python: move the notmuch module section to notes.rst
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-24 01:30:04 +01:00
Justus Winter
8dfbba05fa python: move the usage example to quickstart.rst
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-24 01:18:54 +01:00
Justus Winter
fb52083bf7 python: strip module prefix in the sphinx documentation
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>
2012-02-24 00:38:47 +01:00
Justus Winter
90fb4e8334 python: mention the exception class refactoring in the docs
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-23 00:14:59 +01:00
Justus Winter
ba95980cf1 python: refactor the python bindings
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>
2012-02-22 22:06:45 +01:00
Justus Winter
4bb9f59ff6 python: fix the projects name and update years of the copyright notice in the sphinx docs
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-20 21:48:35 +01:00
Justus Winter
ab2f9fd828 python: remove trailing whitespace within the documentation source files
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18 01:41:23 +01:00
Justus Winter
ff8f864245 python: wrap notmuch_query_count_threads as Query.count_threads
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18 01:39:39 +01:00
Justus Winter
ae376c774e python: mock out the ctypes library
This allows rtfd.org to build the documentation without libnotmuch.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-10 18:55:33 +01:00
Justus Winter
8c5be7d12d python: Add a Mock class to the sphinx config that can be used to mock modules
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-10 18:54:49 +01:00
Patrick Totzke
12ebf87947 fix sphinx compile-time warnings
no changes to the code, only makes compiling the docs smoother
as some rsT syntax errors were fixed
2011-12-06 12:23:50 +01:00
Sebastian Spaeth
42f184c236 python: clean up docstrings and API documentation
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-10-05 17:54:09 +02:00
Sebastian Spaeth
2b43a65c1c python: Add the new exception types in the API documentation
as they should be documented...

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-10-05 16:58:13 +02:00
Sebastian Spaeth
f63d605835 python: Add new functions in API documentation
Add documentation for the three new functions and add in which version
they have been added.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-09-29 11:00:43 +02:00
Sebastian Spaeth
eb4cd33e6b python: Improve code documentation
1) Fix added .gitignore from commit dc8a1745 to work on the docs folder
2) Improve in-code developer documentation to produce better
   sphinx-generated documentation. No code changes.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-09-29 10:47:28 +02:00
Sebastian Spaeth
0817f0e168 python: Improve API documentation
Various API doc cleanups and improvements. No code change.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-06-16 15:41:48 +02:00
Sebastian Spaeth
8866a89e3c python: Remove Messages().__len__
Messages.__len__() exhausted the iterator and list() inherently calls
len(), so we could not invoke list(msgs) without getting errors. Fix
this by implementing __nonzero__ but removing __len__ on Messages.

Use Query.count_messages() or len(list(msgs)) if you need to know the
number.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-06-15 14:25:33 +02:00
Sebastian Spaeth
4d406d9c25 bindings/python: Include the new get_filenames in the API docs
They had accidentally been left out, so we should also include the
function docs for get_messages in the API docs.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-06-02 09:20:56 +02:00
Sebastian Spaeth
af8664689a python: Add UNSORTED as Query.SORT option
Keep up to date with the libnotmuch.so API.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-04-23 13:40:38 +02:00
Carl Worth
3b558de781 Move everything down into a bindings/python directory.
In preparation for merging the python bindings into the notmuch
repository.
2010-04-21 17:29:34 -07:00