~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/store.py

  • Committer: Curtis Hovey
  • Date: 2012-03-16 19:38:35 UTC
  • Revision ID: curtis.hovey@canonical.com-20120316193835-egu5tc1n0xlr5udj
Rename args to be honest about what is expected.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
__metaclass__ = type
2
1
__all__ = [
3
 
    'make_json_message',
4
2
    'MemoryStore',
5
 
    'SUPPORTED_DISPLAY_TYPES',
6
 
    'SUPPORTED_ORDERS',
7
3
    ]
8
4
 
9
5
import email
11
7
from urlparse import parse_qs
12
8
 
13
9
from grackle.error import (
14
 
    ArchiveIdExists,
15
10
    ArchiveIdNotFound,
16
11
    MessageIdNotFound,
17
12
    UnparsableDateRange,
86
81
    def is_multipart(message):
87
82
        return isinstance(message['body'], list)
88
83
 
89
 
    def put_archive(self, archive_id, raw_archive=None):
90
 
        # XXX sinzui 2012-02-29: this needs to raise an error
91
 
        # if the th archive_id is invalid, or the raw archive is not mbox.
92
 
        if archive_id in self.message_archives:
93
 
            raise ArchiveIdExists()
94
 
        self.message_archives[archive_id] = []
95
 
 
96
84
    def put_message(self, archive_id, message_id, raw_message):
97
85
        # XXX sinzui 2012-02-29: this needs to raise an error
98
86
        # if the th archive_id is invalid, message_id is not base32