(self, message)
return self._next_key - 1
Add message and return assigned key.
Add message and return assigned key.
Add message and return assigned key .
def add(self, message):
        """Add message and return assigned key."""
        self._lookup()
        self._toc[self._next_key] = self._append_message(message)
        self._next_key += 1
        # _append_message appends the message to the mailbox file. We
        # don't need a full rewrite + rename, sync is enough.
        self._pending_sync = True
        return self._next_key - 1
def add ( self , message ) : self . _lookup ( ) self . _toc [ self . _next_key ] = self . _append_message ( message ) self . _next_key += 1 # _append_message appends the message to the mailbox file. We # don't need a full rewrite + rename, sync is enough. self . _pending_sync = True return self . _next_key - 1