webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Public Member Functions | Static Public Attributes | List of all members
webkitpy.common.system.filesystem.FileSystem Class Reference
Inheritance diagram for webkitpy.common.system.filesystem.FileSystem:

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
 

Detailed Description

FileSystem interface for webkitpy.

Unless otherwise noted, all paths are allowed to be either absolute
or relative.

Member Function Documentation

◆ abspath()

def webkitpy.common.system.filesystem.FileSystem.abspath (   self,
  path 
)

◆ basename()

def webkitpy.common.system.filesystem.FileSystem.basename (   self,
  path 
)

◆ chdir()

def webkitpy.common.system.filesystem.FileSystem.chdir (   self,
  path 
)

◆ compare()

def webkitpy.common.system.filesystem.FileSystem.compare (   self,
  path1,
  path2 
)

◆ copyfile()

def webkitpy.common.system.filesystem.FileSystem.copyfile (   self,
  source,
  destination 
)

◆ copytree()

def webkitpy.common.system.filesystem.FileSystem.copytree (   self,
  source,
  destination 
)

◆ dirname()

def webkitpy.common.system.filesystem.FileSystem.dirname (   self,
  path 
)

◆ dirs_under()

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.

◆ exists()

def webkitpy.common.system.filesystem.FileSystem.exists (   self,
  path 
)

◆ expanduser()

def webkitpy.common.system.filesystem.FileSystem.expanduser (   self,
  path 
)

◆ files_under()

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.

◆ getcwd()

def webkitpy.common.system.filesystem.FileSystem.getcwd (   self)

◆ getsize()

def webkitpy.common.system.filesystem.FileSystem.getsize (   self,
  path 
)

◆ glob()

def webkitpy.common.system.filesystem.FileSystem.glob (   self,
  path 
)

◆ isabs()

def webkitpy.common.system.filesystem.FileSystem.isabs (   self,
  path 
)

◆ isdir()

def webkitpy.common.system.filesystem.FileSystem.isdir (   self,
  path 
)

◆ isfile()

def webkitpy.common.system.filesystem.FileSystem.isfile (   self,
  path 
)

◆ join()

def webkitpy.common.system.filesystem.FileSystem.join (   self,
  comps 
)

◆ listdir()

def webkitpy.common.system.filesystem.FileSystem.listdir (   self,
  path 
)

◆ maybe_make_directory()

def webkitpy.common.system.filesystem.FileSystem.maybe_make_directory (   self,
  path 
)
Create the specified directory if it doesn't already exist.

◆ mkdtemp()

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.

◆ move()

def webkitpy.common.system.filesystem.FileSystem.move (   self,
  source,
  destination 
)

◆ mtime()

def webkitpy.common.system.filesystem.FileSystem.mtime (   self,
  path 
)

◆ normpath()

def webkitpy.common.system.filesystem.FileSystem.normpath (   self,
  path 
)

◆ open_binary_file_for_reading()

def webkitpy.common.system.filesystem.FileSystem.open_binary_file_for_reading (   self,
  path 
)

◆ open_binary_tempfile()

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.

◆ open_stdin()

def webkitpy.common.system.filesystem.FileSystem.open_stdin (   self)

◆ open_text_file_for_reading()

def webkitpy.common.system.filesystem.FileSystem.open_text_file_for_reading (   self,
  path,
  errors = 'strict' 
)

◆ open_text_file_for_writing()

def webkitpy.common.system.filesystem.FileSystem.open_text_file_for_writing (   self,
  path,
  should_append = False 
)

◆ path_to_module()

def webkitpy.common.system.filesystem.FileSystem.path_to_module (   self,
  module_name 
)
A wrapper for all calls to __file__ to allow easy unit testing.

◆ read_binary_file()

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.

◆ read_text_file()

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.

◆ realpath()

def webkitpy.common.system.filesystem.FileSystem.realpath (   self,
  path 
)

◆ relpath()

def webkitpy.common.system.filesystem.FileSystem.relpath (   self,
  path,
  start = '.' 
)

◆ remove()

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.

◆ rmtree()

def webkitpy.common.system.filesystem.FileSystem.rmtree (   self,
  path 
)
Delete the directory rooted at path, whether empty or not.

◆ sha1()

def webkitpy.common.system.filesystem.FileSystem.sha1 (   self,
  path 
)

◆ split()

def webkitpy.common.system.filesystem.FileSystem.split (   self,
  path 
)
Return (dirname, basename + '.' + ext)

◆ splitext()

def webkitpy.common.system.filesystem.FileSystem.splitext (   self,
  path 
)
Return (dirname + os.sep + basename, '.' + ext)

◆ write_binary_file()

def webkitpy.common.system.filesystem.FileSystem.write_binary_file (   self,
  path,
  contents 
)

◆ write_text_file()

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.

Member Data Documentation

◆ pardir

webkitpy.common.system.filesystem.FileSystem.pardir = os.pardir
static

◆ sep

webkitpy.common.system.filesystem.FileSystem.sep = os.sep
static

The documentation for this class was generated from the following file: