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

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

Issue 10704252: Extensions Docs Server: Internal file system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests Created 8 years, 5 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/subversion_file_system.py
diff --git a/chrome/common/extensions/docs/server2/subversion_file_system.py b/chrome/common/extensions/docs/server2/subversion_file_system.py
new file mode 100644
index 0000000000000000000000000000000000000000..7af3855a52d7cdb08aa1372e90285efcc60e48b6
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/subversion_file_system.py
@@ -0,0 +1,22 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import re
+
+from async_fetch_value import AsyncFetchValue
+from file_system import FileSystem
+from lazy_value import LazyValue
+
+class SubversionFileSystem(FileSystem):
not at google - send to devlin 2012/07/18 10:39:16 sweeet
+ """Class to fetch resources from src.chromium.org.
+ """
+ def __init__(self, fetcher):
+ self._fetcher = fetcher
+
+ def Read(self, paths):
+ return LazyValue(delegate=AsyncFetchValue(paths, self._fetcher))
+
+ def Stat(self, path):
+ dir_html = self._fetcher.fetch(path).content
+ return self.StatInfo(int(re.search('([0-9]+)', dir_html).group(0)))

Powered by Google App Engine
This is Rietveld 408576698