inputs.py 文件源码

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

项目:webmon 作者: KarolBedkowski 项目源码 文件源码
def _load_entry(self, entry, fields, add_content):
        res = list(_get_val_from_rss_entry(entry, fields))
        if add_content:
            content = _get_content_from_rss_entry(entry)
            if content:
                if self._conf["html2text"]:
                    try:
                        import html2text as h2t
                        content = h2t.HTML2Text(bodywidth=74).handle(content)
                    except ImportError:
                        self._ctx.log_error(
                            "RssInput: loading HTML2Text error "
                            "(module not found)")
                res.append("")
                res.extend("    " + line.strip()
                           for line in content.strip().split("\n"))
        self._ctx.log_debug(repr(res))
        return "\n".join(res).strip()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号