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

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

Issue 10826037: Extensions Docs Server: Fix zipper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: process -> binary 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/subversion_file_system.py
diff --git a/chrome/common/extensions/docs/server2/subversion_file_system.py b/chrome/common/extensions/docs/server2/subversion_file_system.py
index 5b10f88c68f028f0646bfd7984d1d5091d662005..b5d26429776543cff0e0a62ed5ec4791ec4d89dc 100644
--- a/chrome/common/extensions/docs/server2/subversion_file_system.py
+++ b/chrome/common/extensions/docs/server2/subversion_file_system.py
@@ -14,8 +14,8 @@ class SubversionFileSystem(file_system.FileSystem):
def __init__(self, fetcher):
self._fetcher = fetcher
- def Read(self, paths):
- return Future(delegate=_AsyncFetchFuture(paths, self._fetcher))
+ def Read(self, paths, binary=False):
+ return Future(delegate=_AsyncFetchFuture(paths, self._fetcher, binary))
def Stat(self, path):
directory = path.rsplit('/', 1)[0]
@@ -23,12 +23,13 @@ class SubversionFileSystem(file_system.FileSystem):
return self.StatInfo(int(re.search('([0-9]+)', dir_html).group(0)))
class _AsyncFetchFuture(object):
- def __init__(self, paths, fetcher):
+ def __init__(self, paths, fetcher, binary):
# A list of tuples of the form (path, Future).
self._fetches = []
self._value = {}
self._error = None
self._fetches = [(path, fetcher.FetchAsync(path)) for path in paths]
+ self._binary = binary
def _ListDir(self, directory):
dom = xml.parseString(directory)
@@ -44,8 +45,10 @@ class _AsyncFetchFuture(object):
self._value[path] = None
elif path.endswith('/'):
self._value[path] = self._ListDir(result.content)
- else:
+ elif not self._binary:
self._value[path] = file_system._ProcessFileData(result.content, path)
+ else:
+ self._value[path] = result.content
if self._error is not None:
raise self._error
return self._value

Powered by Google App Engine
This is Rietveld 408576698