~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/client.py

  • Committer: Curtis Hovey
  • Date: 2012-03-17 21:19:55 UTC
  • Revision ID: curtis.hovey@canonical.com-20120317211955-4eghomev1zoq511s
Change argument order to reflect common usage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
)
8
8
 
9
9
from grackle.error import (
 
10
    ArchiveIdExists,
10
11
    MessageIdNotFound,
11
12
    UnparsableDateRange,
12
13
    UnsupportedDisplayType,
55
56
        :param mbox: An optional mbox with messages to add to the new archive.
56
57
        """
57
58
        response = self._method_archive(
58
 
            'POST', '', {'archive_id': archive_id}, None)
 
59
            'PUT', archive_id, {}, None)
59
60
        response.read()
60
61
        if response.status == httplib.BAD_REQUEST:
 
62
            if response.reason == ArchiveIdExists.__doc__:
 
63
                raise ArchiveIdExists
61
64
            raise Exception('wtf')
62
65
        elif response.status == httplib.CREATED:
63
66
            return
77
80
            'PUT', path, {}, file_obj.read())
78
81
        response.read()
79
82
        if response.status == httplib.BAD_REQUEST:
 
83
            if response.reason == ArchiveIdExists.__doc__:
 
84
                raise ArchiveIdExists
80
85
            raise Exception('wtf')
81
86
        elif response.status == httplib.CREATED:
82
87
            return