Skip to content

Commit

Permalink
Add missing get_bytes() method to mailboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
BjarniRunar committed Oct 23, 2014
1 parent 16d2491 commit 1ef3c99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mailpile/mailboxes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@ def get_msg_size(self, toc_id):
fd.seek(0, 2)
return fd.tell()

def get_bytes(self, toc_id):
return self.get_file(toc_id).read()

return UnorderedPicklableMailbox
3 changes: 3 additions & 0 deletions mailpile/mailboxes/mbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,8 @@ def get_file_by_ptr(self, msg_ptr):
# multiple PartialFile objects in flight at once.
return mailbox._PartialFile(self._get_fd(), start, start + length)

def get_bytes(self, toc_id):
return self.get_file(toc_id).read()


mailpile.mailboxes.register(90, MailpileMailbox)

0 comments on commit 1ef3c99

Please sign in to comment.