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

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: Tests! 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..18fbe22b6753dba57d7155c75211767ccdb7ba05 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):
+ versions = dict((filename, os.stat(os.path.join(path, filename)).st_mtime)
+ for filename in os.listdir(path))
+ 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)
+ if not path.endswith('/'):
+ return self.StatInfo(
+ os.stat(os.path.join(self._base_path, path)).st_mtime, {})
not at google - send to devlin 2012/08/13 05:34:15 This logic is basically repeated in _CreateStatInf
cduvall 2012/08/13 19:45:45 Done.
+ return self._CreateStatInfo(os.path.join(self._base_path, path))
except OSError:
raise file_system.FileNotFoundError(path)
-

Powered by Google App Engine
This is Rietveld 408576698