本文整理汇总了Python中appy.pod.odf_parser.OdfParser.characters方法的典型用法代码示例。如果您正苦于以下问题:Python OdfParser.characters方法的具体用法?Python OdfParser.characters怎么用?Python OdfParser.characters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appy.pod.odf_parser.OdfParser
的用法示例。
在下文中一共展示了OdfParser.characters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: characters
# 需要导入模块: from appy.pod.odf_parser import OdfParser [as 别名]
# 或者: from appy.pod.odf_parser.OdfParser import characters [as 别名]
def characters(self, content):
e = OdfParser.characters(self, content)
if not self.ignore:
for c in content:
if XML_SPECIAL_CHARS.has_key(c):
self.res += XML_SPECIAL_CHARS[c]
else:
self.res += c
示例2: characters
# 需要导入模块: from appy.pod.odf_parser import OdfParser [as 别名]
# 或者: from appy.pod.odf_parser.OdfParser import characters [as 别名]
def characters(self, content):
e = OdfParser.characters(self, content)
if e.state == e.IGNORING:
pass
elif e.state == e.READING_CONTENT:
e.currentBuffer.dumpContent(content)
elif e.state == e.READING_STATEMENT:
if e.currentElem.elem.startswith(e.namespaces[e.NS_TEXT]):
e.currentContent += content
elif e.state == e.READING_EXPRESSION:
e.currentContent += content
示例3: characters
# 需要导入模块: from appy.pod.odf_parser import OdfParser [as 别名]
# 或者: from appy.pod.odf_parser.OdfParser import characters [as 别名]
def characters(self, content):
e = OdfParser.characters(self, content)
if e.state == e.IGNORING:
pass
elif e.state == e.READING_CONTENT:
if e.currentOdsExpression:
# Do not write content if we have encountered an ODS expression:
# we will replace this content with the expression's result.
pass
else:
e.currentBuffer.dumpContent(content)
elif e.state == e.READING_STATEMENT:
if e.currentElem.elem.startswith(e.namespaces[e.NS_TEXT]):
e.currentContent += content
elif e.state == e.READING_EXPRESSION:
e.currentContent += content
示例4: characters
# 需要导入模块: from appy.pod.odf_parser import OdfParser [as 别名]
# 或者: from appy.pod.odf_parser.OdfParser import characters [as 别名]
def characters(self, content):
e = OdfParser.characters(self, content)
if not self.ignore:
self.res += escapeXml(content)