ink.py 文件源码

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

项目:noc-orchestrator 作者: DirceuSilvaLabs 项目源码 文件源码
def render(self):
        # make local variables for the loop below (faster)
        local_dict = self.key_dict
        local_template = self.template
        local_varlist = self.template.varlist
        local_odel = self.odel
        local_cdel = self.cdel
        local_htmlent = self.html_entities
        if local_htmlent:
            from xml.sax.saxutils import escape #from Python std lib
        for key in local_dict:
            if key in local_varlist:
                value = local_dict[key]
                replace_string = local_odel + key + local_cdel
                if local_htmlent:
                    value = escape(value) #xml.sax.saxutils function
                local_template = local_template.replace(replace_string, value)
        return local_template

    ##TODO : multiple file render method?
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号