scantree.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:denite.nvim 作者: Shougo 项目源码 文件源码
def scantree(path_name, skip_list=None):
        """This function returns the files present in path_name, including the
        files present in subfolders.

        Implementation uses scandir, if available, as it is faster than
        os.walk"""

        if skip_list is None:
            skip_list = DEFAULT_SKIP_LIST

        try:
            for entry in (e for e in scandir(path_name)
                          if not is_ignored(e.path, skip_list)):
                if entry.is_dir(follow_symlinks=False):
                    yield from scantree(entry.path, skip_list)
                else:
                    yield entry.path
        except PermissionError:
            yield 'PermissionError reading {}'.format(path_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号