diff options
Diffstat (limited to 'Tools/Scripts/webkitpy/common/system/filesystem.py')
-rw-r--r-- | Tools/Scripts/webkitpy/common/system/filesystem.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Tools/Scripts/webkitpy/common/system/filesystem.py b/Tools/Scripts/webkitpy/common/system/filesystem.py index 05513a9..b876807 100644 --- a/Tools/Scripts/webkitpy/common/system/filesystem.py +++ b/Tools/Scripts/webkitpy/common/system/filesystem.py @@ -39,13 +39,20 @@ import shutil import tempfile import time +from webkitpy.common.system import ospath + class FileSystem(object): """FileSystem interface for webkitpy. Unless otherwise noted, all paths are allowed to be either absolute or relative.""" def __init__(self): - self.sep = os.sep + self._sep = os.sep + + def _get_sep(self): + return self._sep + + sep = property(_get_sep, doc="pathname separator") def abspath(self, path): return os.path.abspath(path) @@ -165,8 +172,8 @@ class FileSystem(object): if e.errno != errno.EEXIST: raise - def move(self, src, dest): - shutil.move(src, dest) + def move(self, source, destination): + shutil.move(source, destination) def mtime(self, path): return os.stat(path).st_mtime @@ -200,6 +207,9 @@ class FileSystem(object): with codecs.open(path, 'r', 'utf8') as f: return f.read() + def relpath(self, path, start='.'): + return ospath.relpath(path, start) + class _WindowsError(exceptions.OSError): """Fake exception for Linux and Mac.""" pass |