Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4730)

Unified Diff: chrome/common/extensions/docs/server2/fetcher_cache.py

Issue 10689144: Extensions Docs Server: Samples zip files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Samples page with full links and descriptions Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/fetcher_cache.py
diff --git a/chrome/common/extensions/docs/server2/fetcher_cache.py b/chrome/common/extensions/docs/server2/fetcher_cache.py
index dc3b12ede4bb8e78999d28871f0d60c006a8bed2..73a247e0ac680c32888879da4a11f8eef84e76a1 100644
--- a/chrome/common/extensions/docs/server2/fetcher_cache.py
+++ b/chrome/common/extensions/docs/server2/fetcher_cache.py
@@ -34,13 +34,16 @@ class FetcherCache(object):
self._populate_function = populate_function
self._cache = {}
- def get(self, key):
+ def get(self, key, get_dir=False):
if key in self._cache:
if self._cache[key].HasExpired():
self._cache.pop(key)
else:
return self._cache[key]._cache_data
- cache_data = self._fetcher.FetchResource(key).content
+ if get_dir:
+ cache_data = self._fetcher.FetchDirectory(key).content
+ else:
+ cache_data = self._fetcher.FetchResource(key).content
self._cache[key] = self._CacheEntry(self._populate_function(cache_data),
time.time() + self._timeout_seconds)
return self._cache[key]._cache_data

Powered by Google App Engine
This is Rietveld 408576698