code: def add_message(self, path, tags=None, afterwards=None):
          
          tags = tags or []
  
          if self.ro:
              raise DatabaseROError()
          if not is_subdir_of(path, self.path):
              msg = 'message path %s ' % path
              msg += ' is not below notmuchs '
              msg += 'root path (%s)' % self.path
              raise DatabaseError(msg)
          else:
              self.writequeue.append(('add', afterwards, path, tags))
docs: Adds a file to the notmuch index.
  
          :param path: path to the file
          :type path: str
          :param tags: tagstrings to add
          :type tags: list of str
          :param afterwards: callback to trigger after adding
          :type afterwards: callable or None