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

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

Issue 10829348: Extensions Docs Server: Large performance increase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes and ObjectStore 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/file_system.py
diff --git a/chrome/common/extensions/docs/server2/file_system.py b/chrome/common/extensions/docs/server2/file_system.py
index 6d3357b0ea6112fa8907ab89c0ad6bbb06e87a1b..540abe8fe606705f7f698b3420993752aec35ac4 100644
--- a/chrome/common/extensions/docs/server2/file_system.py
+++ b/chrome/common/extensions/docs/server2/file_system.py
@@ -8,6 +8,13 @@ class FileNotFoundError(Exception):
def __init__(self, filename):
Exception.__init__(self, filename)
+class StatInfo(object):
+ """The result of calling Stat on a FileSystem.
+ """
+ def __init__(self, version, child_versions=None):
+ self.version = version
+ self.child_versions = child_versions
+
def _ProcessFileData(data, path):
if os.path.splitext(path)[-1] not in ['.js', '.html', '.json']:
return data
@@ -19,12 +26,6 @@ def _ProcessFileData(data, path):
class FileSystem(object):
"""A FileSystem interface that can read files and directories.
"""
- class StatInfo(object):
- """The result of calling Stat on a FileSystem.
- """
- def __init__(self, version, child_versions=None):
- self.version = version
- self.child_versions = child_versions
def Read(self, paths, binary=False):
"""Reads each file in paths and returns a dictionary mapping the path to the
@@ -42,6 +43,7 @@ class FileSystem(object):
"""
return self.Read([path]).Get()[path]
+ # TODO(cduvall): Allow Stat to take a list of paths like Read.
def Stat(self, path):
"""Returns a |StatInfo| object containing the version of |path|. If |path|
is a directory, |StatInfo| will have the versions of all the children of

Powered by Google App Engine
This is Rietveld 408576698