~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/client.py

  • Committer: Aaron Bentley
  • Date: 2012-01-13 14:30:09 UTC
  • mto: (6.1.30 trunk)
  • mto: This revision was merged to the branch mainline in revision 45.
  • Revision ID: aaron@canonical.com-20120113143009-t0kzaz3czxnv1nwz
get_messagesĀ supportsĀ headerĀ parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
            raise Exception('!!')
45
45
 
46
46
    def get_messages(self, archive_id, message_ids=None, limit=None,
47
 
                     memo=None, order=None):
 
47
                     memo=None, order=None, headers=None):
48
48
        parameters = {}
49
49
        if message_ids is not None:
50
50
            parameters['message_ids'] = message_ids
54
54
            parameters['memo'] = memo
55
55
        if order is not None:
56
56
            parameters['order'] = order
 
57
        if headers is not None:
 
58
            parameters['headers'] = headers
57
59
        query = {'parameters': simplejson.dumps(parameters)}
58
60
        response = self._verb_archive('GET', archive_id, query)
59
61
        if response.status == httplib.BAD_REQUEST:
60
62
            raise UnsupportedOrder
61
63
        data = response.read()
62
64
        return simplejson.loads(data)
 
65