OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging | |
6 import re | |
7 import posixpath | 5 import posixpath |
| 6 from file_system import FileSystem, FileNotFoundError, StatInfo, ToUnicode |
| 7 from future import Future |
8 import xml.dom.minidom as xml | 8 import xml.dom.minidom as xml |
9 from xml.parsers.expat import ExpatError | 9 from xml.parsers.expat import ExpatError |
10 | 10 |
11 from appengine_url_fetcher import AppEngineUrlFetcher | 11 from appengine_url_fetcher import AppEngineUrlFetcher |
12 from docs_server_utils import StringIdentity | 12 from docs_server_utils import StringIdentity |
13 from file_system import FileSystem, FileNotFoundError, StatInfo, ToUnicode | |
14 from future import Future | 13 from future import Future |
15 import svn_constants | 14 import svn_constants |
16 import url_constants | 15 import url_constants |
17 | 16 |
18 class _AsyncFetchFuture(object): | 17 class _AsyncFetchFuture(object): |
19 def __init__(self, paths, fetcher, binary, args=None): | 18 def __init__(self, paths, fetcher, binary, args=None): |
20 def apply_args(path): | 19 def apply_args(path): |
21 return path if args is None else '%s?%s' % (path, args) | 20 return path if args is None else '%s?%s' % (path, args) |
22 # A list of tuples of the form (path, Future). | 21 # A list of tuples of the form (path, Future). |
23 self._fetches = [(path, fetcher.FetchAsync(apply_args(path))) | 22 self._fetches = [(path, fetcher.FetchAsync(apply_args(path))) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if path.endswith('/'): | 161 if path.endswith('/'): |
163 return stat_info | 162 return stat_info |
164 if filename not in stat_info.child_versions: | 163 if filename not in stat_info.child_versions: |
165 raise FileNotFoundError('%s was not in child versions' % filename) | 164 raise FileNotFoundError('%s was not in child versions' % filename) |
166 return StatInfo(stat_info.child_versions[filename]) | 165 return StatInfo(stat_info.child_versions[filename]) |
167 | 166 |
168 def GetIdentity(self): | 167 def GetIdentity(self): |
169 # NOTE: no revision here, consider it just an implementation detail of the | 168 # NOTE: no revision here, consider it just an implementation detail of the |
170 # file version that is handled by Stat. | 169 # file version that is handled by Stat. |
171 return '@'.join((self.__class__.__name__, StringIdentity(self._svn_path))) | 170 return '@'.join((self.__class__.__name__, StringIdentity(self._svn_path))) |
OLD | NEW |