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 |
index 7ccca1c1e73a9f64a0d394c2562af3a078697fd3..05025de4eb4d83b714d65d192f71483befeaaa5a 100644 |
--- a/chrome/common/extensions/docs/server2/appengine_url_fetcher.py |
+++ b/chrome/common/extensions/docs/server2/appengine_url_fetcher.py |
@@ -2,8 +2,6 @@ |
# 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 |
- |
from future import Future |
class _AsyncFetchDelegate(object): |
@@ -18,17 +16,18 @@ class AppEngineUrlFetcher(object): |
"""A wrapper around the App Engine urlfetch module that allows for easy |
async fetches. |
""" |
- def __init__(self, base_path): |
+ def __init__(self, base_path, urlfetch): |
self._base_path = base_path |
+ self._urlfetch = urlfetch |
def Fetch(self, url): |
"""Fetches a file synchronously. |
""" |
- return urlfetch.fetch(self._base_path + '/' + url) |
+ return self._urlfetch.fetch(self._base_path + '/' + url) |
def FetchAsync(self, url): |
"""Fetches a file asynchronously, and returns a Future with the result. |
""" |
- rpc = urlfetch.create_rpc() |
- urlfetch.make_fetch_call(rpc, self._base_path + '/' + url) |
+ rpc = self._urlfetch.create_rpc() |
+ self._urlfetch.make_fetch_call(rpc, self._base_path + '/' + url) |
return Future(delegate=_AsyncFetchDelegate(rpc)) |