通过remote_api_shell.py获取get_serving_url

时间:2011-08-10 21:19:24

标签: python google-app-engine console

我想记录我使用appengine存储的图像的所有当前网址。但是,当使用appengine的remote_api_shell.py控制台时,即使我在本地计算机上正确设置了PIL,我也无法使用get_serving_url函数。

>>> 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/Resources/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

现在我只是想在appengine生产机器上为我做脏工作,但我觉得应该有办法通过控制台调用get_serving_url函数。

1 个答案:

答案 0 :(得分:2)

remote_api目前没有get_serving_url API调用的映射。您可以通过导入remote_api_services并将其添加到适当位置的dict中来自行添加,但无论哪种方式,您都应该file a feature request