discussion.py 文件源码

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

项目:idealoom 作者: conversence 项目源码 文件源码
def as_mind_map(request):
    """Provide a mind-map like representation of the table of ideas"""
    for mimetype in request.GET.getall('mimetype'):
        mimetype = mimetype
        if mimetype in pygraphviz_formats:
            break
    else:
        mimetype = request.accept.best_match(list(pygraphviz_formats.keys()))
        if not mimetype:
            raise HTTPNotAcceptable("Not known to pygraphviz: "+mimetype)
    discussion = request.context._instance
    G = discussion.as_mind_map()
    G.layout(prog='twopi')
    io = BytesIO()
    G.draw(io, format=pygraphviz_formats[mimetype])
    io.seek(0)
    return Response(body_file=io, content_type=mimetype)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号