OLD | NEW |
---|---|
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 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 28 matching lines...) Expand all Loading... | |
39 import tempfile | 39 import tempfile |
40 import time | 40 import time |
41 | 41 |
42 class FileSystem(object): | 42 class FileSystem(object): |
43 """FileSystem interface for webkitpy. | 43 """FileSystem interface for webkitpy. |
44 | 44 |
45 Unless otherwise noted, all paths are allowed to be either absolute | 45 Unless otherwise noted, all paths are allowed to be either absolute |
46 or relative.""" | 46 or relative.""" |
47 sep = os.sep | 47 sep = os.sep |
48 pardir = os.pardir | 48 pardir = os.pardir |
49 pathsep = os.pathsep | |
Dirk Pranke
2015/06/15 23:41:48
You shouldn't need this (see other comments).
burnik
2015/06/16 09:24:34
Done.
| |
49 | 50 |
50 def abspath(self, path): | 51 def abspath(self, path): |
51 return os.path.abspath(path) | 52 return os.path.abspath(path) |
52 | 53 |
53 def realpath(self, path): | 54 def realpath(self, path): |
54 return os.path.realpath(path) | 55 return os.path.realpath(path) |
55 | 56 |
56 def path_to_module(self, module_name): | 57 def path_to_module(self, module_name): |
57 """A wrapper for all calls to __file__ to allow easy unit testing.""" | 58 """A wrapper for all calls to __file__ to allow easy unit testing.""" |
58 # FIXME: This is the only use of sys in this file. It's possible this fu nction should move elsewhere. | 59 # FIXME: This is the only use of sys in this file. It's possible this fu nction should move elsewhere. |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 def copytree(self, source, destination): | 264 def copytree(self, source, destination): |
264 shutil.copytree(source, destination) | 265 shutil.copytree(source, destination) |
265 | 266 |
266 def split(self, path): | 267 def split(self, path): |
267 """Return (dirname, basename + '.' + ext)""" | 268 """Return (dirname, basename + '.' + ext)""" |
268 return os.path.split(path) | 269 return os.path.split(path) |
269 | 270 |
270 def splitext(self, path): | 271 def splitext(self, path): |
271 """Return (dirname + os.sep + basename, '.' + ext)""" | 272 """Return (dirname + os.sep + basename, '.' + ext)""" |
272 return os.path.splitext(path) | 273 return os.path.splitext(path) |
OLD | NEW |