genericmanager.py 文件源码

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

项目:s3contents 作者: danielfrg 项目源码 文件源码
def get(self, path, content=True, type=None, format=None):
        # Get a file or directory model.
        self.log.debug("S3contents.GenericManager.get] path('%s') type(%s) format(%s)", path, type, format)
        path = path.strip('/')

        if type is None:
            type = self.guess_type(path)
        try:
            func = {
                "directory": self._get_directory,
                "notebook": self._get_notebook,
                "file": self._get_file,
            }[type]
        except KeyError:
            raise ValueError("Unknown type passed: '{}'".format(type))

        return func(path=path, content=content, format=format)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号