| OLD | NEW |
| 1 # Copyright (C) 2009 Google Inc. All rights reserved. | 1 # Copyright (C) 2009 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 files = [] | 216 files = [] |
| 217 for f in self.files: | 217 for f in self.files: |
| 218 if self.exists(f) and f.startswith(top): | 218 if self.exists(f) and f.startswith(top): |
| 219 remaining = f[len(top):] | 219 remaining = f[len(top):] |
| 220 if sep in remaining: | 220 if sep in remaining: |
| 221 dir = remaining[:remaining.index(sep)] | 221 dir = remaining[:remaining.index(sep)] |
| 222 if not dir in dirs: | 222 if not dir in dirs: |
| 223 dirs.append(dir) | 223 dirs.append(dir) |
| 224 else: | 224 else: |
| 225 files.append(remaining) | 225 files.append(remaining) |
| 226 return [(top[:-1], dirs, files)] | 226 file_system_tuples = [(top[:-1], dirs, files)] |
| 227 for dir in dirs: |
| 228 dir = top + dir |
| 229 tuples_from_subdirs = self.walk(dir) |
| 230 file_system_tuples += tuples_from_subdirs |
| 231 return file_system_tuples |
| 227 | 232 |
| 228 def mtime(self, path): | 233 def mtime(self, path): |
| 229 if self.exists(path): | 234 if self.exists(path): |
| 230 return 0 | 235 return 0 |
| 231 self._raise_not_found(path) | 236 self._raise_not_found(path) |
| 232 | 237 |
| 233 def _mktemp(self, suffix='', prefix='tmp', dir=None, **kwargs): | 238 def _mktemp(self, suffix='', prefix='tmp', dir=None, **kwargs): |
| 234 if dir is None: | 239 if dir is None: |
| 235 dir = self.sep + '__im_tmp' | 240 dir = self.sep + '__im_tmp' |
| 236 curno = self.current_tmpno | 241 curno = self.current_tmpno |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 return self.data.readline(length) | 490 return self.data.readline(length) |
| 486 | 491 |
| 487 def __iter__(self): | 492 def __iter__(self): |
| 488 return self.data.__iter__() | 493 return self.data.__iter__() |
| 489 | 494 |
| 490 def next(self): | 495 def next(self): |
| 491 return self.data.next() | 496 return self.data.next() |
| 492 | 497 |
| 493 def seek(self, offset, whence=os.SEEK_SET): | 498 def seek(self, offset, whence=os.SEEK_SET): |
| 494 self.data.seek(offset, whence) | 499 self.data.seek(offset, whence) |
| OLD | NEW |