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

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

Issue 10828235: Extensions Docs Server: Efficient MemcacheFileSystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes and comments Created 8 years, 4 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 89dfd9faba4bc729f1ca0b787779379100b70f2c..7937fd0249250edb706acd04b6821d6244ec68ba 100644
--- a/chrome/common/extensions/docs/server2/local_file_system.py
+++ b/chrome/common/extensions/docs/server2/local_file_system.py
@@ -52,10 +52,16 @@ class LocalFileSystem(file_system.FileSystem):
result[path] = self._ReadFile(self._ConvertToFilepath(path), binary)
return Future(value=result)
+ def _CreateStatInfo(self, path):
+ if path.endswith('/'):
+ versions = dict((filename, os.stat(os.path.join(path, filename)).st_mtime)
+ for filename in os.listdir(path))
+ else:
+ versions = None
+ return self.StatInfo(os.stat(path).st_mtime, versions)
+
def Stat(self, path):
try:
- return self.StatInfo(
- os.stat(os.path.join(self._base_path, path)).st_mtime)
+ return self._CreateStatInfo(os.path.join(self._base_path, path))
except OSError:
raise file_system.FileNotFoundError(path)
-
« no previous file with comments | « chrome/common/extensions/docs/server2/handler.py ('k') | chrome/common/extensions/docs/server2/memcache_file_system.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698