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 posixpath | 5 import posixpath |
6 import traceback | 6 import traceback |
7 | 7 |
8 from future import Future | 8 from future import Future |
9 from path_util import ( | 9 from path_util import ( |
10 AssertIsDirectory, AssertIsValid, IsDirectory, IsValid, SplitParent, | 10 AssertIsDirectory, AssertIsValid, IsDirectory, IsValid, SplitParent, |
(...skipping 11 matching lines...) Expand all Loading... |
22 return Future(callback=boom) | 22 return Future(callback=boom) |
23 | 23 |
24 | 24 |
25 class FileNotFoundError(_BaseFileSystemException): | 25 class FileNotFoundError(_BaseFileSystemException): |
26 '''Raised when a file isn't found for read or stat. | 26 '''Raised when a file isn't found for read or stat. |
27 ''' | 27 ''' |
28 def __init__(self, filename): | 28 def __init__(self, filename): |
29 _BaseFileSystemException.__init__(self, filename) | 29 _BaseFileSystemException.__init__(self, filename) |
30 | 30 |
31 | 31 |
| 32 class FileSystemThrottledError(_BaseFileSystemException): |
| 33 '''Raised when access to a file system resource is temporarily unavailable |
| 34 due to service throttling. |
| 35 ''' |
| 36 def __init__(self, filename): |
| 37 _BaseFileSystemException.__init__(self, filename) |
| 38 |
| 39 |
32 class FileSystemError(_BaseFileSystemException): | 40 class FileSystemError(_BaseFileSystemException): |
33 '''Raised on when there are errors reading or statting files, such as a | 41 '''Raised on when there are errors reading or statting files, such as a |
34 network timeout. | 42 network timeout. |
35 ''' | 43 ''' |
36 def __init__(self, filename): | 44 def __init__(self, filename): |
37 _BaseFileSystemException.__init__(self, filename) | 45 _BaseFileSystemException.__init__(self, filename) |
38 | 46 |
39 | 47 |
40 class StatInfo(object): | 48 class StatInfo(object): |
41 '''The result of calling Stat on a FileSystem. | 49 '''The result of calling Stat on a FileSystem. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 self.GetIdentity() == other.GetIdentity()) | 218 self.GetIdentity() == other.GetIdentity()) |
211 | 219 |
212 def __ne__(self, other): | 220 def __ne__(self, other): |
213 return not (self == other) | 221 return not (self == other) |
214 | 222 |
215 def __repr__(self): | 223 def __repr__(self): |
216 return '<%s>' % type(self).__name__ | 224 return '<%s>' % type(self).__name__ |
217 | 225 |
218 def __str__(self): | 226 def __str__(self): |
219 return repr(self) | 227 return repr(self) |
OLD | NEW |