get_serving_url via remote_api_shell.py
I want to record all the current urls for images I'm storing using appengine. However, when using appengine's remote_api_shell.py console, I'm unable to use the get_serving_url function even though I have PIL set up correctly on my local machine.
>>> c.image_blob
<google.appengine.ext.blobstore.blobstore.BlobInfo object at 0x16f0150>
>>> from google.appengine.api.images import get_serving_url
>>> get_serving_url(c.image_blob)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resour开发者_如何学Cces/google_appengine/google/appengine/api/images/__init__.py", line 1231, in get_serving_url
response)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 94, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 308, in MakeSyncCall
rpc.CheckSuccess()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_rpc.py", line 156, in _WaitImpl
self.request, self.response)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 178, in MakeSyncCall
self._MakeRealSyncCall(service, call, request, response)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 198, in _MakeRealSyncCall
raise pickle.loads(response_pb.exception())
CallNotFoundError
For now I just made a view to do the dirty work for me on appengine production machines, but I feel like there should be a way of calling the get_serving_url function via the console.
remote_api
doesn't currently have a mapping for the get_serving_url
API call. You can add it yourself by importing remote_api_services and adding it to the dict in the appropriate place, but either way you should definitely file a feature request.
精彩评论