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."""
24 from google
.appengine
.api
.images
import images_blob_stub
27 class ImagesNotImplementedServiceStub(object):
28 """Stub version of images API which raises a NotImplementedError."""
30 def __init__(self
, host_prefix
=""):
31 self
._blob
_stub
= images_blob_stub
.ImagesBlobStub(host_prefix
)
33 def MakeSyncCall(self
, service
, call
, request
, response
, request_id
=None):
37 service: str, must be 'images'.
38 call: str, name of the RPC to make, must be part of ImagesService.
39 request: pb object, corresponding args to the 'call' argument.
40 response: pb object, return value for the 'call' argument.
41 request_id: A unique string identifying the request associated with the
44 if service
== "images":
45 if call
== "GetUrlBase":
46 self
._blob
_stub
.GetUrlBase(request
, response
)
48 elif call
== "DeleteUrlBase":
49 self
._blob
_stub
.DeleteUrlBase(request
, response
)
51 raise NotImplementedError("Unable to find the Python PIL library. Please "
52 "view the SDK documentation for details about "
53 "installing PIL on your system.")