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

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

Issue 10826037: Extensions Docs Server: Fix zipper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/local_file_system.py
diff --git a/chrome/common/extensions/docs/server2/local_file_system.py b/chrome/common/extensions/docs/server2/local_file_system.py
index 44efcc07026bbda3d5c85e8b47352a95fe8f650d..2b989ac4661ad5b6e3e328dac5ec6a0e0c7c04a9 100644
--- a/chrome/common/extensions/docs/server2/local_file_system.py
+++ b/chrome/common/extensions/docs/server2/local_file_system.py
@@ -17,9 +17,11 @@ class LocalFileSystem(file_system.FileSystem):
def _ConvertToFilepath(self, path):
return path.replace('/', os.sep)
- def _ReadFile(self, filename):
+ def _ReadFile(self, filename, process):
with open(os.path.join(self._base_path, filename), 'r') as f:
- return file_system._ProcessFileData(f.read(), filename)
+ if process:
not at google - send to devlin 2012/07/27 04:54:36 Safer to make it clear that f is only being read o
cduvall 2012/07/27 18:12:28 Done.
+ return file_system._ProcessFileData(f.read(), filename)
+ return f.read()
def _ListDir(self, dir_name):
all_files = []
@@ -33,13 +35,13 @@ class LocalFileSystem(file_system.FileSystem):
all_files.append(path)
return all_files
- def Read(self, paths):
+ def Read(self, paths, process=True):
result = {}
for path in paths:
if path.endswith('/'):
result[path] = self._ListDir(self._ConvertToFilepath(path))
else:
- result[path] = self._ReadFile(self._ConvertToFilepath(path))
+ result[path] = self._ReadFile(self._ConvertToFilepath(path), process)
return Future(value=result)
def Stat(self, path):

Powered by Google App Engine
This is Rietveld 408576698