aboutsummaryrefslogtreecommitdiff
path: root/bindings/python
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2017-08-27 15:54:50 -0300
committerDavid Bremner <david@tethera.net>2017-08-27 15:54:50 -0300
commita565f71e1c160431ff99f088bc8fc08d367603a2 (patch)
tree2f7c33d7296e15b2c33f6ede436d412c812c3f15 /bindings/python
parent00f87faf4bc19e90e19b8b27c13845efb6a68152 (diff)
parent6354745dcd6505c5f12c185a29c25a8d1c240595 (diff)
Merge tag 'debian/0.25-6' into debian/stretch-backports
Diffstat (limited to 'bindings/python')
-rw-r--r--bindings/python/docs/source/query.rst2
-rw-r--r--bindings/python/notmuch/database.py16
-rw-r--r--bindings/python/notmuch/query.py22
-rw-r--r--bindings/python/notmuch/thread.py2
-rw-r--r--bindings/python/notmuch/version.py4
5 files changed, 31 insertions, 15 deletions
diff --git a/bindings/python/docs/source/query.rst b/bindings/python/docs/source/query.rst
index 044b5735..785e984b 100644
--- a/bindings/python/docs/source/query.rst
+++ b/bindings/python/docs/source/query.rst
@@ -29,7 +29,7 @@
.. attribute:: sort
Instance attribute :attr:`sort` contains the sort order (see
- :attr:`Query.SORT`) if explicitely specified via
+ :attr:`Query.SORT`) if explicitly specified via
:meth:`set_sort`. By default it is set to `None`.
.. automethod:: exclude_tag
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
index 67fb1c41..8f918069 100644
--- a/bindings/python/notmuch/database.py
+++ b/bindings/python/notmuch/database.py
@@ -86,6 +86,11 @@ class Database(object):
_get_version.argtypes = [NotmuchDatabaseP]
_get_version.restype = c_uint
+ """notmuch_database_get_revision"""
+ _get_revision = nmlib.notmuch_database_get_revision
+ _get_revision.argtypes = [NotmuchDatabaseP, POINTER(c_char_p)]
+ _get_revision.restype = c_uint
+
"""notmuch_database_open"""
_open = nmlib.notmuch_database_open
_open.argtypes = [c_char_p, c_uint, POINTER(NotmuchDatabaseP)]
@@ -261,6 +266,17 @@ class Database(object):
self._assert_db_is_initialized()
return Database._get_version(self._db)
+ def get_revision (self):
+ """Returns the committed database revison and UUID
+
+ :returns: (revison, uuid) The database revision as a positive integer
+ and the UUID of the database.
+ """
+ self._assert_db_is_initialized()
+ uuid = c_char_p ()
+ revision = Database._get_revision(self._db, byref (uuid))
+ return (revision, uuid.value.decode ('utf-8'))
+
_needs_upgrade = nmlib.notmuch_database_needs_upgrade
_needs_upgrade.argtypes = [NotmuchDatabaseP]
_needs_upgrade.restype = bool
diff --git a/bindings/python/notmuch/query.py b/bindings/python/notmuch/query.py
index a0f4f64b..06c7b11b 100644
--- a/bindings/python/notmuch/query.py
+++ b/bindings/python/notmuch/query.py
@@ -134,10 +134,10 @@ class Query(object):
self._assert_query_is_initialized()
self._exclude_tag(self._query, _str(tagname))
- """notmuch_query_search_threads_st"""
- _search_threads_st = nmlib.notmuch_query_search_threads_st
- _search_threads_st.argtypes = [NotmuchQueryP, POINTER(NotmuchThreadsP)]
- _search_threads_st.restype = c_uint
+ """notmuch_query_search_threads"""
+ _search_threads = nmlib.notmuch_query_search_threads
+ _search_threads.argtypes = [NotmuchQueryP, POINTER(NotmuchThreadsP)]
+ _search_threads.restype = c_uint
def search_threads(self):
"""Execute a query for threads
@@ -155,7 +155,7 @@ class Query(object):
"""
self._assert_query_is_initialized()
threads_p = NotmuchThreadsP() # == NULL
- status = Query._search_threads_st(self._query, byref(threads_p))
+ status = Query._search_threads(self._query, byref(threads_p))
if status != 0:
raise NotmuchError(status)
@@ -164,9 +164,9 @@ class Query(object):
return Threads(threads_p, self)
"""notmuch_query_search_messages_st"""
- _search_messages_st = nmlib.notmuch_query_search_messages_st
- _search_messages_st.argtypes = [NotmuchQueryP, POINTER(NotmuchMessagesP)]
- _search_messages_st.restype = c_uint
+ _search_messages = nmlib.notmuch_query_search_messages
+ _search_messages.argtypes = [NotmuchQueryP, POINTER(NotmuchMessagesP)]
+ _search_messages.restype = c_uint
def search_messages(self):
"""Filter messages according to the query and return
@@ -177,7 +177,7 @@ class Query(object):
"""
self._assert_query_is_initialized()
msgs_p = NotmuchMessagesP() # == NULL
- status = Query._search_messages_st(self._query, byref(msgs_p))
+ status = Query._search_messages(self._query, byref(msgs_p))
if status != 0:
raise NotmuchError(status)
@@ -185,7 +185,7 @@ class Query(object):
raise NullPointerError
return Messages(msgs_p, self)
- _count_messages = nmlib.notmuch_query_count_messages_st
+ _count_messages = nmlib.notmuch_query_count_messages
_count_messages.argtypes = [NotmuchQueryP, POINTER(c_uint)]
_count_messages.restype = c_uint
@@ -204,7 +204,7 @@ class Query(object):
raise NotmuchError(status)
return count.value
- _count_threads = nmlib.notmuch_query_count_threads_st
+ _count_threads = nmlib.notmuch_query_count_threads
_count_threads.argtypes = [NotmuchQueryP, POINTER(c_uint)]
_count_threads.restype = c_uint
diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py
index cc151f7e..ed961885 100644
--- a/bindings/python/notmuch/thread.py
+++ b/bindings/python/notmuch/thread.py
@@ -245,7 +245,7 @@ class Thread(object):
The :class:`Tags` object is owned by the thread and as such, will only
be valid for as long as this :class:`Thread` is valid (e.g. until the
- query from which it derived is explicitely deleted).
+ query from which it derived is explicitly deleted).
:returns: A :class:`Tags` iterator.
:raises: :exc:`NotInitializedError` if query is not initialized
diff --git a/bindings/python/notmuch/version.py b/bindings/python/notmuch/version.py
index 49bca347..62dd1f19 100644
--- a/bindings/python/notmuch/version.py
+++ b/bindings/python/notmuch/version.py
@@ -1,3 +1,3 @@
# this file should be kept in sync with ../../../version
-__VERSION__ = '0.24.2'
-SOVERSION = '4'
+__VERSION__ = '0.25'
+SOVERSION = '5'