Chromium Code Reviews| 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)) |