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