~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/client.py

  • Committer: Curtis Hovey
  • Date: 2012-03-16 20:16:12 UTC
  • Revision ID: curtis.hovey@canonical.com-20120316201612-lr7b32umqgduaja6
Added a rudimentary put_archive.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
)
8
8
 
9
9
from grackle.error import (
10
 
    ArchiveIdExists,
11
10
    MessageIdNotFound,
12
11
    UnparsableDateRange,
13
12
    UnsupportedDisplayType,
59
58
            'PUT', archive_id, {}, None)
60
59
        response.read()
61
60
        if response.status == httplib.BAD_REQUEST:
62
 
            if response.reason == ArchiveIdExists.__doc__:
63
 
                raise ArchiveIdExists
64
61
            raise Exception('wtf')
65
62
        elif response.status == httplib.CREATED:
66
63
            return
80
77
            'PUT', path, {}, file_obj.read())
81
78
        response.read()
82
79
        if response.status == httplib.BAD_REQUEST:
83
 
            if response.reason == ArchiveIdExists.__doc__:
84
 
                raise ArchiveIdExists
85
80
            raise Exception('wtf')
86
81
        elif response.status == httplib.CREATED:
87
82
            return