third_party/blink/tools/blinkpy/common/system/filesystem.py
def files_under(self, path, dirs_to_skip=None, file_filter=None):
        """Walks the filesystem tree under the given path in top-down 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.

        Returns:
            A list of all files under the given path in top-down order.
        """
        dirs_to_skip = dirs_to_skip or []

        def filter_all(fs, dirpath, basename):
            return True

        file_filter = file_filter or filter_all
        files = []
        if self.isfile(path):
            if file_filter(self, self.dirname(path), self.basename(path)):
                files.append(path)
            return files

        if self.basename(path) in dirs_to_skip:
            return []

        for (dirpath, dirnames, filenames) in os.walk(path):
            for d in dirs_to_skip:
                if d in dirnames:
                    dirnames.remove(d)

            for filename in filenames:
                if file_filter(self, dirpath, filename):
                    files.append(self.join(dirpath, filename))
        return files
Walks the filesystem tree under the given path in top-down 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.

        Returns:
            A list of all files under the given path in top-down order.
        
Walks the filesystem tree under the given path in top-down order.
Walks the filesystem tree under the given path in top - down order .
def files_under(self, path, dirs_to_skip=None, file_filter=None):
        dirs_to_skip = dirs_to_skip or []
        def filter_all(fs, dirpath, basename):
            return True
        file_filter = file_filter or filter_all
        files = []
        if self.isfile(path):
            if file_filter(self, self.dirname(path), self.basename(path)):
                files.append(path)
            return files
        if self.basename(path) in dirs_to_skip:
            return []
        for (dirpath, dirnames, filenames) in os.walk(path):
            for d in dirs_to_skip:
                if d in dirnames:
                    dirnames.remove(d)
            for filename in filenames:
                if file_filter(self, dirpath, filename):
                    files.append(self.join(dirpath, filename))
        return files
def files_under ( self , path , dirs_to_skip = None , file_filter = None ) : dirs_to_skip = dirs_to_skip or [ ] def filter_all ( fs , dirpath , basename ) : return True file_filter = file_filter or filter_all files = [ ] if self . isfile ( path ) : if file_filter ( self , self . dirname ( path ) , self . basename ( path ) ) : files . append ( path ) return files if self . basename ( path ) in dirs_to_skip : return [ ] for ( dirpath , dirnames , filenames ) in os . walk ( path ) : for d in dirs_to_skip : if d in dirnames : dirnames . remove ( d ) for filename in filenames : if file_filter ( self , dirpath , filename ) : files . append ( self . join ( dirpath , filename ) ) return files
Walks the filesystem tree under the given path in top-down order.
Walks the filesystem tree under the given path in top - down order .
"""Walks the filesystem tree under the given path in top-down 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.

        Returns:
            A list of all files under the given path in top-down order.
        """
A list of all files under the given path in top-down order.
A list of all files under the given path in top - down order .
self
path
dirs_to_skip
A list of directories to skip over during the
traversal .
A list of directories to skip over during the traversal .
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.
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 .