Changeset 90043 in webkit
- Timestamp:
- Jun 29, 2011 2:22:52 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90040 r90043 1 2011-06-29 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Remove duplicate methods in filesystem.py 6 https://bugs.webkit.org/show_bug.cgi?id=63658 7 8 Looks like there was a bad merge at some point. 9 10 I also removed a bunch of redundant docstrings. 11 12 * Scripts/webkitpy/common/system/filesystem.py: 13 1 14 2011-06-29 Adam Barth <abarth@webkit.org> 2 15 -
trunk/Tools/Scripts/webkitpy/common/system/filesystem.py
r89843 r90043 68 68 69 69 def copyfile(self, source, destination): 70 """Copies the contents of the file at the given path to the destination71 path."""72 70 shutil.copyfile(source, destination) 73 71 74 72 def dirname(self, path): 75 """Wraps os.path.dirname()."""76 73 return os.path.dirname(path) 77 74 78 75 def exists(self, path): 79 """Return whether the path exists in the filesystem."""80 76 return os.path.exists(path) 81 77 … … 115 111 116 112 def getcwd(self): 117 """Wraps os.getcwd()."""118 113 return os.getcwd() 119 114 120 115 def glob(self, path): 121 """Wraps glob.glob()."""122 116 return glob.glob(path) 123 117 124 118 def isabs(self, path): 125 """Return whether the path is an absolute path."""126 119 return os.path.isabs(path) 127 120 128 121 def isfile(self, path): 129 """Return whether the path refers to a file."""130 122 return os.path.isfile(path) 131 123 132 124 def isdir(self, path): 133 """Return whether the path refers to a directory."""134 125 return os.path.isdir(path) 135 126 136 127 def join(self, *comps): 137 """Return the path formed by joining the components."""138 128 return os.path.join(*comps) 139 129 140 130 def listdir(self, path): 141 """Return the contents of the directory pointed to by path."""142 131 return os.listdir(path) 143 132 … … 189 178 190 179 def normpath(self, path): 191 """Wraps os.path.normpath()."""192 180 return os.path.normpath(path) 193 181 … … 199 187 200 188 def open_text_file_for_writing(self, path, append=False): 201 """Returns a file handle suitable for writing to."""202 189 mode = 'w' 203 190 if append: … … 250 237 251 238 def rmtree(self, path): 252 """Delete the directory rooted at path, empty or no."""239 """Delete the directory rooted at path, whether empty or not.""" 253 240 shutil.rmtree(path, ignore_errors=True) 254 255 def read_binary_file(self, path):256 """Return the contents of the file at the given path as a byte string."""257 with file(path, 'rb') as f:258 return f.read()259 260 def read_text_file(self, path):261 """Return the contents of the file at the given path as a Unicode string.262 263 The file is read assuming it is a UTF-8 encoded file with no BOM."""264 with codecs.open(path, 'r', 'utf8') as f:265 return f.read()266 241 267 242 def split(self, path): … … 274 249 275 250 def write_binary_file(self, path, contents): 276 """Write the contents to the file at the given location."""277 251 with file(path, 'wb') as f: 278 252 f.write(contents)
Note: See TracChangeset
for help on using the changeset viewer.