Now that types are checked correctly, we also need to make sure that all the
arguments actually are instances of these types. Otherwise the function calls
will fail and raise an exception similar to this one:
ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: expected
LP_LP_NotmuchMessageS instance instead of pointer to c_void_p
_open = nmlib.notmuch_database_open
_open.argtypes = [c_char_p, c_uint]
_open.restype = NotmuchDatabaseP
_open = nmlib.notmuch_database_open
_open.argtypes = [c_char_p, c_uint]
_open.restype = NotmuchDatabaseP
+ #_open.restype = c_void_p
"""notmuch_database_upgrade"""
_upgrade = nmlib.notmuch_database_upgrade
"""notmuch_database_upgrade"""
_upgrade = nmlib.notmuch_database_upgrade
be added.
"""
self._assert_db_is_initialized()
be added.
"""
self._assert_db_is_initialized()
+ msg_p = NotmuchMessageP()
status = self._add_message(self._db, _str(filename), byref(msg_p))
if not status in [STATUS.SUCCESS, STATUS.DUPLICATE_MESSAGE_ID]:
status = self._add_message(self._db, _str(filename), byref(msg_p))
if not status in [STATUS.SUCCESS, STATUS.DUPLICATE_MESSAGE_ID]:
the database was not intitialized.
"""
self._assert_db_is_initialized()
the database was not intitialized.
"""
self._assert_db_is_initialized()
+ msg_p = NotmuchMessageP()
status = Database._find_message(self._db, _str(msgid), byref(msg_p))
if status != STATUS.SUCCESS:
raise NotmuchError(status)
status = Database._find_message(self._db, _str(msgid), byref(msg_p))
if status != STATUS.SUCCESS:
raise NotmuchError(status)
*Added in notmuch 0.9*"""
self._assert_db_is_initialized()
*Added in notmuch 0.9*"""
self._assert_db_is_initialized()
+ msg_p = NotmuchMessageP()
status = Database._find_message_by_filename(self._db, _str(filename),
byref(msg_p))
if status != STATUS.SUCCESS:
status = Database._find_message_by_filename(self._db, _str(filename),
byref(msg_p))
if status != STATUS.SUCCESS: