App Engine Python SDK version 1.9.12
[gae.git] / python / google / appengine / api / images / images_not_implemented_stub.py
blob5bf992f7b0a7c1720141bded6492b41ef60c09fd
1 #!/usr/bin/env python
3 # Copyright 2007 Google Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 """A NotImplemented Images API stub for when the PIL library is not found."""
23 from google.appengine.api import apiproxy_stub
24 from google.appengine.api.images import images_blob_stub
26 _SERVICE_NAME = 'images'
29 class ImagesNotImplementedServiceStub(apiproxy_stub.APIProxyStub):
30 """Stub version of images API which raises a NotImplementedError."""
32 def __init__(self, host_prefix=''):
33 super(ImagesNotImplementedServiceStub, self).__init__(_SERVICE_NAME)
34 self._blob_stub = images_blob_stub.ImagesBlobStub(host_prefix)
36 def MakeSyncCall(self, service, call, request, response, request_id=None):
37 """Main entry point.
39 Args:
40 service: str, must be 'images'.
41 call: str, name of the RPC to make, must be part of ImagesService.
42 request: pb object, corresponding args to the 'call' argument.
43 response: pb object, return value for the 'call' argument.
44 request_id: A unique string identifying the request associated with the
45 API call.
46 """
47 if service == _SERVICE_NAME:
48 if call == 'GetUrlBase':
49 self._blob_stub.GetUrlBase(request, response)
50 return
51 elif call == 'DeleteUrlBase':
52 self._blob_stub.DeleteUrlBase(request, response)
53 return
54 raise NotImplementedError('Unable to find the Python PIL library. Please '
55 'view the SDK documentation for details about '
56 'installing PIL on your system.')