webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Classes | |
class | _WindowsError |
Public Member Functions | |
def | abspath (self, path) |
def | realpath (self, path) |
def | path_to_module (self, module_name) |
def | expanduser (self, path) |
def | basename (self, path) |
def | chdir (self, path) |
def | copyfile (self, source, destination) |
def | dirname (self, path) |
def | exists (self, path) |
def | dirs_under (self, path, dir_filter=None) |
def | files_under (self, path, dirs_to_skip=[], file_filter=None) |
def | getcwd (self) |
def | glob (self, path) |
def | isabs (self, path) |
def | isfile (self, path) |
def | getsize (self, path) |
def | isdir (self, path) |
def | join (self, comps) |
def | listdir (self, path) |
def | mkdtemp (self, kwargs) |
def | maybe_make_directory (self, path) |
def | move (self, source, destination) |
def | mtime (self, path) |
def | normpath (self, path) |
def | open_binary_tempfile (self, suffix) |
def | open_binary_file_for_reading (self, path) |
def | read_binary_file (self, path) |
def | write_binary_file (self, path, contents) |
def | open_text_file_for_reading (self, path, errors='strict') |
def | open_text_file_for_writing (self, path, should_append=False) |
def | open_stdin (self) |
def | read_text_file (self, path) |
def | write_text_file (self, path, contents) |
def | sha1 (self, path) |
def | relpath (self, path, start='.') |
def | remove (self, path, osremove=os.remove) |
def | rmtree (self, path) |
def | copytree (self, source, destination) |
def | split (self, path) |
def | splitext (self, path) |
def | compare (self, path1, path2) |
Static Public Attributes | |
sep = os.sep | |
pardir = os.pardir | |
FileSystem interface for webkitpy. Unless otherwise noted, all paths are allowed to be either absolute or relative.
def webkitpy.common.system.filesystem.FileSystem.abspath | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.basename | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.chdir | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.compare | ( | self, | |
path1, | |||
path2 | |||
) |
def webkitpy.common.system.filesystem.FileSystem.copyfile | ( | self, | |
source, | |||
destination | |||
) |
def webkitpy.common.system.filesystem.FileSystem.copytree | ( | self, | |
source, | |||
destination | |||
) |
def webkitpy.common.system.filesystem.FileSystem.dirname | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.dirs_under | ( | self, | |
path, | |||
dir_filter = None |
|||
) |
Return the list of all directories under the given path in topdown order. Args: dir_filter: if not None, the filter will be invoked with the filesystem object and the path of each dirfound. The dir is included in the result if the callback returns True.
def webkitpy.common.system.filesystem.FileSystem.exists | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.expanduser | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.files_under | ( | self, | |
path, | |||
dirs_to_skip = [] , |
|||
file_filter = None |
|||
) |
Return the list of all files under the given path in topdown order. Args: dirs_to_skip: a list of directories to skip over during the traversal (e.g., .svn, resources, etc.) file_filter: if not None, the filter will be invoked with the filesystem object and the dirname and basename of each file found. The file is included in the result if the callback returns True.
def webkitpy.common.system.filesystem.FileSystem.getcwd | ( | self | ) |
def webkitpy.common.system.filesystem.FileSystem.getsize | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.glob | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.isabs | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.isdir | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.isfile | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.join | ( | self, | |
comps | |||
) |
def webkitpy.common.system.filesystem.FileSystem.listdir | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.maybe_make_directory | ( | self, | |
path | |||
) |
Create the specified directory if it doesn't already exist.
def webkitpy.common.system.filesystem.FileSystem.mkdtemp | ( | self, | |
kwargs | |||
) |
Create and return a uniquely named directory. This is like tempfile.mkdtemp, but if used in a with statement the directory will self-delete at the end of the block (if the directory is empty; non-empty directories raise errors). The directory can be safely deleted inside the block as well, if so desired. Note that the object returned is not a string and does not support all of the string methods. If you need a string, coerce the object to a string and go from there.
def webkitpy.common.system.filesystem.FileSystem.move | ( | self, | |
source, | |||
destination | |||
) |
def webkitpy.common.system.filesystem.FileSystem.mtime | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.normpath | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.open_binary_file_for_reading | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.open_binary_tempfile | ( | self, | |
suffix | |||
) |
Create, open, and return a binary temp file. Returns a tuple of the file and the name.
def webkitpy.common.system.filesystem.FileSystem.open_stdin | ( | self | ) |
def webkitpy.common.system.filesystem.FileSystem.open_text_file_for_reading | ( | self, | |
path, | |||
errors = 'strict' |
|||
) |
def webkitpy.common.system.filesystem.FileSystem.open_text_file_for_writing | ( | self, | |
path, | |||
should_append = False |
|||
) |
def webkitpy.common.system.filesystem.FileSystem.path_to_module | ( | self, | |
module_name | |||
) |
A wrapper for all calls to __file__ to allow easy unit testing.
def webkitpy.common.system.filesystem.FileSystem.read_binary_file | ( | self, | |
path | |||
) |
Return the contents of the file at the given path as a byte string.
def webkitpy.common.system.filesystem.FileSystem.read_text_file | ( | self, | |
path | |||
) |
Return the contents of the file at the given path as a Unicode string. The file is read assuming it is a UTF-8 encoded file with no BOM.
def webkitpy.common.system.filesystem.FileSystem.realpath | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.relpath | ( | self, | |
path, | |||
start = '.' |
|||
) |
def webkitpy.common.system.filesystem.FileSystem.remove | ( | self, | |
path, | |||
osremove = os.remove |
|||
) |
On Windows, if a process was recently killed and it held on to a file, the OS will hold on to the file for a short while. This makes attempts to delete the file fail. To work around that, this method will retry for a few seconds until Windows is done with the file.
def webkitpy.common.system.filesystem.FileSystem.rmtree | ( | self, | |
path | |||
) |
Delete the directory rooted at path, whether empty or not.
def webkitpy.common.system.filesystem.FileSystem.sha1 | ( | self, | |
path | |||
) |
def webkitpy.common.system.filesystem.FileSystem.split | ( | self, | |
path | |||
) |
Return (dirname, basename + '.' + ext)
def webkitpy.common.system.filesystem.FileSystem.splitext | ( | self, | |
path | |||
) |
Return (dirname + os.sep + basename, '.' + ext)
def webkitpy.common.system.filesystem.FileSystem.write_binary_file | ( | self, | |
path, | |||
contents | |||
) |
def webkitpy.common.system.filesystem.FileSystem.write_text_file | ( | self, | |
path, | |||
contents | |||
) |
Write the contents to the file at the given location. The file is written encoded as UTF-8 with no BOM.
|
static |
|
static |