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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 yield root[len(basepath):].rstrip('/'), dirs, files | 165 yield root[len(basepath):].rstrip('/'), dirs, files |
166 | 166 |
167 for d in dirs: | 167 for d in dirs: |
168 for walkinfo in walk(root + d): | 168 for walkinfo in walk(root + d): |
169 yield walkinfo | 169 yield walkinfo |
170 | 170 |
171 for walkinfo in walk(root): | 171 for walkinfo in walk(root): |
172 yield walkinfo | 172 yield walkinfo |
173 | 173 |
| 174 def __eq__(self, other): |
| 175 return (isinstance(other, FileSystem) and |
| 176 self.GetIdentity() == other.GetIdentity()) |
| 177 |
| 178 def __ne__(self, other): |
| 179 return not (self == other) |
| 180 |
174 def __repr__(self): | 181 def __repr__(self): |
175 return '<%s>' % type(self).__name__ | 182 return '<%s>' % type(self).__name__ |
176 | 183 |
177 def __str__(self): | 184 def __str__(self): |
178 return repr(self) | 185 return repr(self) |
OLD | NEW |