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

« back to all changes in this revision

Viewing changes to grackle/client.py

  • Committer: Curtis Hovey
  • Date: 2012-01-30 21:30:02 UTC
  • mto: (6.1.31 trunk)
  • mto: This revision was merged to the branch mainline in revision 45.
  • Revision ID: curtis.hovey@canonical.com-20120130213002-ldo7j2z2wh9ujsww
Moved the handling of unsupported display_type to server.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
            parameters['headers'] = headers
119
119
        if max_body_length is not None:
120
120
            parameters['max_body_length'] = max_body_length
121
 
        if display_type not in SUPPORTED_DISPLAY_TYPES:
122
 
            raise UnsupportedDisplayType
123
121
        parameters['display_type'] = display_type
124
122
        parameters['include_hidden'] = include_hidden
125
123
        query = {'parameters': simplejson.dumps(parameters)}
126
124
        response = self._method_archive('GET', archive_id, query)
127
125
        if response.status == httplib.BAD_REQUEST:
128
 
            raise UnsupportedOrder
 
126
            if response.reason == 'Unsupported order':
 
127
                raise UnsupportedOrder
 
128
            elif response.reason == 'Unsupported display_type':
 
129
                raise UnsupportedDisplayType
 
130
            else:
 
131
                raise ValueError('Bad request')
129
132
        data = response.read()
130
133
        return simplejson.loads(data)