Exemple #1
0
    def needs_upgrade(self):
        """Does this database need to be upgraded before writing to it?

        If this function returns `True` then no functions that modify the
        database (:meth:`add_message`,
        :meth:`Message.add_tag`, :meth:`Directory.set_mtime`,
        etc.) will work unless :meth:`upgrade` is called successfully first.

        :returns: `True` or `False`
        """
        self._assert_db_is_initialized()
        return nmlib.notmuch_database_needs_upgrade(self._db)
Exemple #2
0
    def needs_upgrade(self):
        """Does this database need to be upgraded before writing to it?

        If this function returns `True` then no functions that modify the
        database (:meth:`add_message`,
        :meth:`Message.add_tag`, :meth:`Directory.set_mtime`,
        etc.) will work unless :meth:`upgrade` is called successfully first.

        :returns: `True` or `False`
        :exception: :exc:`NotmuchError` with :attr:`STATUS`.NOT_INITIALIZED if
                    the database was not intitialized.
        """
        self._assert_db_is_initialized()
        return nmlib.notmuch_database_needs_upgrade(self._db)