model.py 文件源码

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

项目:sardana 作者: sardana-org 项目源码 文件源码
def toolTip(self, index):
        if index.column() > 0:
            return self.data(index)
        obj = self.itemData()
        if hasattr(obj, "exc_info") and obj.exc_info is not None:
            html_orig = '<html><head><style type="text/css">{style}' \
                        '</style></head><body>'
            formatter, style = None, ""
            if pygments is not None:
                formatter = HtmlFormatter()
                style = formatter.get_style_defs()
            txt = html_orig.format(style=style)
            if formatter is None:
                txt += "<pre>%s</pre>" % obj.exc_info
            else:
                txt += highlight(obj.exc_info, PythonTracebackLexer(),
                                 formatter)
            txt += "</body></html>"
        else:
            txt = "{0} {1}".format(getElementTypeToolTip(obj.type), obj.name)
        return txt
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号