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

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: 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 7360e2a3cae1eced9e594db7c6b5a20bb82c86df..835657f13440f8d7437a3fd19fb6f34eeea02a9d 100644
--- a/chrome/common/extensions/docs/server2/local_file_system.py
+++ b/chrome/common/extensions/docs/server2/local_file_system.py
@@ -45,5 +45,14 @@ class LocalFileSystem(file_system.FileSystem):
result[path] = self._ReadFile(self._ConvertToFilepath(path), binary)
return Future(value=result)
+ def _CreateStatInfo(self, path):
+ versions = [(filename, os.stat(os.path.join(path, filename)).st_mtime)
+ for filename in os.listdir(path)]
not at google - send to devlin 2012/08/10 06:42:24 can construct the dict without an intermediate lis
cduvall 2012/08/11 00:15:23 Done.
+ return self.StatInfo(os.stat(path).st_mtime, dict(versions))
+
def Stat(self, path):
- return self.StatInfo(os.stat(os.path.join(self._base_path, path)).st_mtime)
+ if '/' in path:
+ par_dir = path.rsplit('/', 1)[0] + '/'
+ else:
+ par_dir = '.'
+ return self._CreateStatInfo(os.path.join(self._base_path, par_dir))

Powered by Google App Engine
This is Rietveld 408576698