walk.py 文件源码

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

项目:pyfilesystem2 作者: PyFilesystem 项目源码 文件源码
def _scan(self, fs, dir_path, namespaces):
        """Get an iterator of `Info` objects for a directory path.

        Arguments:
            fs (FS): A filesystem instance.
            dir_path (str): A path to a directory on the filesystem.
            namespaces (list): A list of additional namespaces to
                include in the `Info` objects.

        Returns:
            ~collections.Iterator: iterator of `Info` objects for
            resources within the given path.

        """
        try:
            for info in fs.scandir(dir_path, namespaces=namespaces):
                yield info
        except FSError as error:
            if not self.on_error(dir_path, error):
                six.reraise(type(error), error)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号