diff options
| author | David Bremner <david@tethera.net> | 2017-08-27 15:54:50 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2017-08-27 15:54:50 -0300 |
| commit | a565f71e1c160431ff99f088bc8fc08d367603a2 (patch) | |
| tree | 2f7c33d7296e15b2c33f6ede436d412c812c3f15 /bindings | |
| parent | 00f87faf4bc19e90e19b8b27c13845efb6a68152 (diff) | |
| parent | 6354745dcd6505c5f12c185a29c25a8d1c240595 (diff) | |
Merge tag 'debian/0.25-6' into debian/stretch-backports
Diffstat (limited to 'bindings')
| -rw-r--r-- | bindings/Makefile.local | 1 | ||||
| -rw-r--r-- | bindings/python/docs/source/query.rst | 2 | ||||
| -rw-r--r-- | bindings/python/notmuch/database.py | 16 | ||||
| -rw-r--r-- | bindings/python/notmuch/query.py | 22 | ||||
| -rw-r--r-- | bindings/python/notmuch/thread.py | 2 | ||||
| -rw-r--r-- | bindings/python/notmuch/version.py | 4 | ||||
| -rw-r--r-- | bindings/ruby/extconf.rb | 2 | ||||
| -rw-r--r-- | bindings/ruby/query.c | 8 |
8 files changed, 37 insertions, 20 deletions
diff --git a/bindings/Makefile.local b/bindings/Makefile.local index 11d11d4b..17b561ca 100644 --- a/bindings/Makefile.local +++ b/bindings/Makefile.local @@ -8,6 +8,7 @@ ifeq ($(HAVE_RUBY_DEV),1) cd $(dir)/ruby && \ EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \ LIBNOTMUCH="../../lib/$(LINKER_NAME)" \ + NOTMUCH_SRCDIR='$(NOTMUCH_SRCDIR)' \ ruby extconf.rb --vendor $(MAKE) -C $(dir)/ruby endif 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' diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb index ddaa6841..161de5a2 100644 --- a/bindings/ruby/extconf.rb +++ b/bindings/ruby/extconf.rb @@ -5,7 +5,7 @@ require 'mkmf' -dir = File.join('..', '..', 'lib') +dir = File.join(ENV['NOTMUCH_SRCDIR'], 'lib') # includes $INCFLAGS = "-I#{dir} #{$INCFLAGS}" diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c index ce66926c..8b46d700 100644 --- a/bindings/ruby/query.c +++ b/bindings/ruby/query.c @@ -138,7 +138,7 @@ notmuch_rb_query_search_threads (VALUE self) Data_Get_Notmuch_Query (self, query); - status = notmuch_query_search_threads_st (query, &threads); + status = notmuch_query_search_threads (query, &threads); if (status) notmuch_rb_status_raise (status); @@ -159,7 +159,7 @@ notmuch_rb_query_search_messages (VALUE self) Data_Get_Notmuch_Query (self, query); - status = notmuch_query_search_messages_st (query, &messages); + status = notmuch_query_search_messages (query, &messages); if (status) notmuch_rb_status_raise (status); @@ -180,7 +180,7 @@ notmuch_rb_query_count_messages (VALUE self) Data_Get_Notmuch_Query (self, query); - status = notmuch_query_count_messages_st (query, &count); + status = notmuch_query_count_messages (query, &count); if (status) notmuch_rb_status_raise (status); @@ -201,7 +201,7 @@ notmuch_rb_query_count_threads (VALUE self) Data_Get_Notmuch_Query (self, query); - status = notmuch_query_count_threads_st (query, &count); + status = notmuch_query_count_threads (query, &count); if (status) notmuch_rb_status_raise (status); |
