localize_static.py 文件源码

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

项目:studentsdb 作者: PyDev777 项目源码 文件源码
def _get_commented_CDN_tags(self):
        def get_comment(s):
            return s if isinstance(s, Comment) and '//' in s and s.strip()[:4] in ['<lin', '<scr'] else ''
        comments = bs(self._get_template()).find_all(string=get_comment)
        tags = self._unitags(bs(str(comments)).select('link[href*="//"], script[src*="//"]'))
        if tags:
            for tag in tags:
                for comment in comments:
                    if tag['open'] in comment and tag['ref'] in comment:
                        tag['comment'] = comment
        return tags
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号