| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 def expanduser(self, path): | 89 def expanduser(self, path): |
| 90 if path[0] != "~": | 90 if path[0] != "~": |
| 91 return path | 91 return path |
| 92 parts = path.split(self.sep, 1) | 92 parts = path.split(self.sep, 1) |
| 93 home_directory = self.sep + "Users" + self.sep + "mock" | 93 home_directory = self.sep + "Users" + self.sep + "mock" |
| 94 if len(parts) == 1: | 94 if len(parts) == 1: |
| 95 return home_directory | 95 return home_directory |
| 96 return home_directory + self.sep + parts[1] | 96 return home_directory + self.sep + parts[1] |
| 97 | 97 |
| 98 def path_to_module(self, module_name): | 98 def path_to_module(self, module_name): |
| 99 return "/mock-checkout/third_party/WebKit/Tools/Scripts/" + module_name.
replace('.', '/') + ".py" | 99 return "/mock-checkout/third_party/WebKit/tools/" + module_name.replace(
'.', '/') + ".py" |
| 100 | 100 |
| 101 def chdir(self, path): | 101 def chdir(self, path): |
| 102 path = self.normpath(path) | 102 path = self.normpath(path) |
| 103 if not self.isdir(path): | 103 if not self.isdir(path): |
| 104 raise OSError(errno.ENOENT, path, os.strerror(errno.ENOENT)) | 104 raise OSError(errno.ENOENT, path, os.strerror(errno.ENOENT)) |
| 105 self.cwd = path | 105 self.cwd = path |
| 106 | 106 |
| 107 def copyfile(self, source, destination): | 107 def copyfile(self, source, destination): |
| 108 if not self.exists(source): | 108 if not self.exists(source): |
| 109 self._raise_not_found(source) | 109 self._raise_not_found(source) |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 return self.data.readline(length) | 480 return self.data.readline(length) |
| 481 | 481 |
| 482 def __iter__(self): | 482 def __iter__(self): |
| 483 return self.data.__iter__() | 483 return self.data.__iter__() |
| 484 | 484 |
| 485 def next(self): | 485 def next(self): |
| 486 return self.data.next() | 486 return self.data.next() |
| 487 | 487 |
| 488 def seek(self, offset, whence=os.SEEK_SET): | 488 def seek(self, offset, whence=os.SEEK_SET): |
| 489 self.data.seek(offset, whence) | 489 self.data.seek(offset, whence) |
| OLD | NEW |