mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
python: add notmuch.Database.status_string()
This gives some additional access to debugging information when using the python bindings. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
parent
88c0bc4cc6
commit
8881a61fe7
1 changed files with 16 additions and 0 deletions
|
@ -575,6 +575,22 @@ class Database(object):
|
||||||
"""
|
"""
|
||||||
return Query(self, querystring)
|
return Query(self, querystring)
|
||||||
|
|
||||||
|
"""notmuch_database_status_string"""
|
||||||
|
_status_string = nmlib.notmuch_database_status_string
|
||||||
|
_status_string.argtypes = [NotmuchDatabaseP]
|
||||||
|
_status_string.restype = c_char_p
|
||||||
|
|
||||||
|
def status_string(self):
|
||||||
|
"""Returns the status string of the database
|
||||||
|
|
||||||
|
This is sometimes used for additional error reporting
|
||||||
|
"""
|
||||||
|
self._assert_db_is_initialized()
|
||||||
|
s = Database._status_string(self._db)
|
||||||
|
if s:
|
||||||
|
return s.decode('utf-8', 'ignore')
|
||||||
|
return s
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "'Notmuch DB " + self.get_path() + "'"
|
return "'Notmuch DB " + self.get_path() + "'"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue