本文整理汇总了Python中xml.etree.ElementTree.SubElement.attrib["TIME_VALUE"]方法的典型用法代码示例。如果您正苦于以下问题:Python SubElement.attrib["TIME_VALUE"]方法的具体用法?Python SubElement.attrib["TIME_VALUE"]怎么用?Python SubElement.attrib["TIME_VALUE"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml.etree.ElementTree.SubElement
的用法示例。
在下文中一共展示了SubElement.attrib["TIME_VALUE"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _retrieve_aditional_information
# 需要导入模块: from xml.etree.ElementTree import SubElement [as 别名]
# 或者: from xml.etree.ElementTree.SubElement import attrib["TIME_VALUE"] [as 别名]
def _retrieve_aditional_information(self):
"""This method retrieve all the elan
core file, except the ANNOTATION tags,
to make it possible to reconstruct the
elan file again.
Returns
-------
meta_information : ElementTree
Element with all the elan elements except the Tiers
annotations.
"""
meta_information = Element(self.root._root.tag, self.root._root.attrib)
for element in self.tree:
if element.tag != 'ANNOTATION_DOCUMENT':
if element.tag == 'TIER':
meta_information.append(Element(
element.tag, element.attrib))
else:
parent_element = SubElement(meta_information, element.tag,
element.attrib)
for child in element:
other_child = SubElement(parent_element, child.tag,
child.attrib)
# Update time_slots
if other_child.tag == "TIME_SLOT" and \
"TIME_VALUE" not in other_child:
other_child.attrib["TIME_VALUE"] = \
"{0}".format(self.time_order[
other_child.attrib["TIME_SLOT_ID"]])
if not str(child.text).isspace() or \
child.text is not None:
other_child.text = child.text
return meta_information