The deprecated Database.add_message now calls the new index_file with
correct number of arguments (without an extra `self`), and returns the
tuple from index_file - as it used to do before.
This change also adds a DeprecationWarning to the function.
from ctypes import c_char_p, c_void_p, c_uint, byref, POINTER
from .compat import SafeConfigParser
from .globals import (
from ctypes import c_char_p, c_void_p, c_uint, byref, POINTER
from .compat import SafeConfigParser
from .globals import (
def add_message(self, filename, sync_maildir_flags=False):
"""Deprecated alias for :meth:`index_file`
"""
def add_message(self, filename, sync_maildir_flags=False):
"""Deprecated alias for :meth:`index_file`
"""
- self.index_file(self, filename, sync_maildir_flags=sync_maildir_flags)
+ warnings.warn(
+ "This function is deprecated and will be removed in the future, use index_file.", DeprecationWarning)
+
+ return self.index_file(filename, sync_maildir_flags=sync_maildir_flags)
_remove_message = nmlib.notmuch_database_remove_message
_remove_message.argtypes = [NotmuchDatabaseP, c_char_p]
_remove_message = nmlib.notmuch_database_remove_message
_remove_message.argtypes = [NotmuchDatabaseP, c_char_p]