__init__.py 文件源码

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

项目:linkchecker-gui 作者: linkcheck 项目源码 文件源码
def view_source (self, url, line, col):
        """View URL source in editor window."""
        self.editor.setWindowTitle(u"View %s" % url)
        self.editor.setUrl(url)
        data, info = urlutil.get_content(url, proxy=self.config["proxy"])
        if data is None:
            msg = u"An error occurred retreiving URL `%s': %s." % (url, info)
            self.editor.setText(msg)
        else:
            content_type = httputil.get_content_type(info)
            if not content_type:
                # read function for content type guessing
                read = lambda: data
                content_type = mimeutil.guess_mimetype(url, read=read)
            self.editor.setContentType(content_type)
            self.editor.setText(data, line=line, col=col)
        self.editor.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号