本文整理汇总了Python中template_preprocessor.core.lexer.Token.output方法的典型用法代码示例。如果您正苦于以下问题:Python Token.output方法的具体用法?Python Token.output怎么用?Python Token.output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类template_preprocessor.core.lexer.Token
的用法示例。
在下文中一共展示了Token.output方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: output
# 需要导入模块: from template_preprocessor.core.lexer import Token [as 别名]
# 或者: from template_preprocessor.core.lexer.Token import output [as 别名]
def output(self, handler):
if self.__double_quotes:
handler('"')
Token.output(self, handler)
if self.__double_quotes:
handler('"')
示例2: output
# 需要导入模块: from template_preprocessor.core.lexer import Token [as 别名]
# 或者: from template_preprocessor.core.lexer.Token import output [as 别名]
def output(self, handler):
# Blocktrans output
handler(u"{%blocktrans ")
for p in self.params:
p.output(handler)
handler(u" ")
handler(u"%}")
Token.output(self, handler)
handler(u"{%endblocktrans%}")
示例3: output
# 需要导入模块: from template_preprocessor.core.lexer import Token [as 别名]
# 或者: from template_preprocessor.core.lexer.Token import output [as 别名]
def output(self, handler):
# Blocktrans output
handler(u'{%blocktrans ');
for p in self.params:
p.output(handler)
handler(u' ')
handler(u'%}')
Token.output(self, handler)
handler(u'{%endblocktrans%}')
示例4: output
# 需要导入模块: from template_preprocessor.core.lexer import Token [as 别名]
# 或者: from template_preprocessor.core.lexer.Token import output [as 别名]
def output(self, handler):
# Yield this node's content, or if the variable name
# has been changed, use the modified name.
if self.__varname:
handler(self.__varname)
elif self.__link_to:
self.__link_to.output(handler)
else:
Token.output(self, handler)
示例5: output
# 需要导入模块: from template_preprocessor.core.lexer import Token [as 别名]
# 或者: from template_preprocessor.core.lexer.Token import output [as 别名]
def output(self, handler):
handler('<script ')
handler(u' '.join([ u'%s%s' % (a, self.__attrs[a]) for a in self.__attrs.keys() ]))
handler('>')
if not self.is_external:
handler('//<![CDATA[\n')
Token.output(self, handler)
if not self.is_external:
handler(u'//]]>\n')
handler(u'</script>')
示例6: output
# 需要导入模块: from template_preprocessor.core.lexer import Token [as 别名]
# 或者: from template_preprocessor.core.lexer.Token import output [as 别名]
def output(self, handler):
handler(u'{%ifdebug%}')
Token.output(self, handler)
handler(u'{%endifdebug%}')