aboutsummaryrefslogtreecommitdiff
path: root/bindings/python
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-12-13 08:39:11 -0400
committerDavid Bremner <david@tethera.net>2015-12-13 08:39:11 -0400
commite3cd357fdddd2d8d29e8eea0b40a1043c46f1791 (patch)
treeb0e4f0549fc1216439e4593b73206c7923995ad4 /bindings/python
parentad5b7434978ed98b1eb832b77684869f5d02594a (diff)
parent1432a4f946e0f236179b53ac71d03764da725f33 (diff)
Merge tag 'debian/0.21-3' into jessie-backports
uploaded to unstable
Diffstat (limited to 'bindings/python')
-rw-r--r--bindings/python/notmuch/query.py22
-rw-r--r--bindings/python/notmuch/version.py2
2 files changed, 16 insertions, 8 deletions
diff --git a/bindings/python/notmuch/query.py b/bindings/python/notmuch/query.py
index 94773ac5..378aa47d 100644
--- a/bindings/python/notmuch/query.py
+++ b/bindings/python/notmuch/query.py
@@ -17,7 +17,7 @@ along with notmuch. If not, see <http://www.gnu.org/licenses/>.
Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
"""
-from ctypes import c_char_p, c_uint
+from ctypes import c_char_p, c_uint, POINTER, byref
from .globals import (
nmlib,
Enum,
@@ -178,8 +178,8 @@ class Query(object):
raise NullPointerError
return Messages(msgs_p, self)
- _count_messages = nmlib.notmuch_query_count_messages
- _count_messages.argtypes = [NotmuchQueryP]
+ _count_messages = nmlib.notmuch_query_count_messages_st
+ _count_messages.argtypes = [NotmuchQueryP, POINTER(c_uint)]
_count_messages.restype = c_uint
def count_messages(self):
@@ -191,10 +191,14 @@ class Query(object):
:rtype: int
'''
self._assert_query_is_initialized()
- return Query._count_messages(self._query)
+ count = c_uint(0)
+ status = Query._count_messages(self._query, byref(count))
+ if status != 0:
+ raise NotmuchError(status)
+ return count.value
- _count_threads = nmlib.notmuch_query_count_threads
- _count_threads.argtypes = [NotmuchQueryP]
+ _count_threads = nmlib.notmuch_query_count_threads_st
+ _count_threads.argtypes = [NotmuchQueryP, POINTER(c_uint)]
_count_threads.restype = c_uint
def count_threads(self):
@@ -210,7 +214,11 @@ class Query(object):
:rtype: int
'''
self._assert_query_is_initialized()
- return Query._count_threads(self._query)
+ count = c_uint(0)
+ status = Query._count_threads(self._query, byref(count))
+ if status != 0:
+ raise NotmuchError(status)
+ return count.value
_destroy = nmlib.notmuch_query_destroy
_destroy.argtypes = [NotmuchQueryP]
diff --git a/bindings/python/notmuch/version.py b/bindings/python/notmuch/version.py
index 1295ac5a..db9d0764 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.20.2'
+__VERSION__ = '0.21'
SOVERSION = '4'