__init__.py 文件源码

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

项目:pillar 作者: armadillica 项目源码 文件源码
def get_file(file_id, api=None):
    # TODO: remove this function and just use the Pillar SDK directly.
    if file_id is None:
        return None

    if api is None:
        api = system_util.pillar_api()

    try:
        return File.find(file_id, api=api)
    except ResourceNotFound:
        f = sys.exc_info()[2].tb_frame.f_back
        tb = traceback.format_stack(f=f, limit=2)
        log.warning('File %s not found, but requested from %s\n%s',
                    file_id, request.url, ''.join(tb))
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号