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

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

Issue 10704252: Extensions Docs Server: Internal file system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests 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/example_zipper.py
diff --git a/chrome/common/extensions/docs/server2/example_zipper.py b/chrome/common/extensions/docs/server2/example_zipper.py
index 7d7fef75559568a14016a2b6b47b51b2293d9cea..1a715dbfda0c6d3c65b5b7eeff32de95f59e99dc 100644
--- a/chrome/common/extensions/docs/server2/example_zipper.py
+++ b/chrome/common/extensions/docs/server2/example_zipper.py
@@ -24,10 +24,8 @@ class ExampleZipper(object):
zip_bytes = BytesIO()
zip_file = ZipFile(zip_bytes, mode='w')
try:
- for filename in files:
- zip_file.writestr(
- filename[len(prefix):].strip('/'),
- self._fetcher.FetchResource(filename).content)
+ for filename, contents in self._fetcher.Read(files).iteritems():
+ zip_file.writestr(filename[len(prefix):].strip('/'), contents.Get())
finally:
zip_file.close()
return zip_bytes.getvalue()
@@ -37,5 +35,5 @@ class ExampleZipper(object):
as returned by |_zip_cache|.
Paths within the zip file are given relative to and including |path|.
"""
- return self._zip_cache.getFromFileListing(self._base_path + '/' + path,
- recursive=True)
+ return self._zip_cache.getFromFileListing(
+ self._base_path + '/' + path + '/')

Powered by Google App Engine
This is Rietveld 408576698