Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/appengine_url_fetcher.py |
| diff --git a/chrome/common/extensions/docs/server2/appengine_url_fetcher.py b/chrome/common/extensions/docs/server2/appengine_url_fetcher.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c4c05e80ea6b66fe9c45b5bb2932e17031b983be |
| --- /dev/null |
| +++ b/chrome/common/extensions/docs/server2/appengine_url_fetcher.py |
| @@ -0,0 +1,18 @@ |
| +# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +from google.appengine.api import urlfetch |
| + |
| +class AppEngineUrlFetcher(object): |
|
not at google - send to devlin
2012/07/18 10:39:15
documentation
cduvall
2012/07/18 21:26:10
Done.
|
| + def __init__(self, base_path): |
| + self._base_path = base_path |
| + |
| + def fetch(self, url): |
|
not at google - send to devlin
2012/07/18 10:39:15
These should all be Google-style, like Fetch.
cduvall
2012/07/18 21:26:10
Done.
|
| + return urlfetch.fetch(self._base_path + '/' + url) |
| + |
| + def create_rpc(self): |
| + return urlfetch.create_rpc() |
| + |
| + def make_fetch_call(self, rpc, path): |
|
not at google - send to devlin
2012/07/18 10:39:15
This *is* the appengine API, I know; but it could
cduvall
2012/07/18 21:26:10
Done.
|
| + return urlfetch.make_fetch_call(rpc, self._base_path + '/' + path) |