genericmanager.py 文件源码

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

项目:s3contents 作者: danielfrg 项目源码 文件源码
def guess_type(self, path, allow_directory=True):
        """
        Guess the type of a file.
        If allow_directory is False, don't consider the possibility that the
        file is a directory.

        Parameters
        ----------
            obj: s3.Object or string
        """
        if path.endswith(".ipynb"):
            return "notebook"
        elif allow_directory and self.dir_exists(path):
            return "directory"
        else:
            return "file"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号