| 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 |
| 5 import posixpath | 7 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 |
| 13 from future import Future | 14 from future import Future |
| 14 import svn_constants | 15 import svn_constants |
| 15 import url_constants | 16 import url_constants |
| 16 | 17 |
| 17 class _AsyncFetchFuture(object): | 18 class _AsyncFetchFuture(object): |
| 18 def __init__(self, paths, fetcher, binary, args=None): | 19 def __init__(self, paths, fetcher, binary, args=None): |
| 19 def apply_args(path): | 20 def apply_args(path): |
| 20 return path if args is None else '%s?%s' % (path, args) | 21 return path if args is None else '%s?%s' % (path, args) |
| 21 # A list of tuples of the form (path, Future). | 22 # A list of tuples of the form (path, Future). |
| 22 self._fetches = [(path, fetcher.FetchAsync(apply_args(path))) | 23 self._fetches = [(path, fetcher.FetchAsync(apply_args(path))) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if path.endswith('/'): | 162 if path.endswith('/'): |
| 162 return stat_info | 163 return stat_info |
| 163 if filename not in stat_info.child_versions: | 164 if filename not in stat_info.child_versions: |
| 164 raise FileNotFoundError('%s was not in child versions' % filename) | 165 raise FileNotFoundError('%s was not in child versions' % filename) |
| 165 return StatInfo(stat_info.child_versions[filename]) | 166 return StatInfo(stat_info.child_versions[filename]) |
| 166 | 167 |
| 167 def GetIdentity(self): | 168 def GetIdentity(self): |
| 168 # NOTE: no revision here, consider it just an implementation detail of the | 169 # NOTE: no revision here, consider it just an implementation detail of the |
| 169 # file version that is handled by Stat. | 170 # file version that is handled by Stat. |
| 170 return '@'.join((self.__class__.__name__, StringIdentity(self._svn_path))) | 171 return '@'.join((self.__class__.__name__, StringIdentity(self._svn_path))) |
| OLD | NEW |