Пример #1
0
def regular_xml(path, filename):
    global count
    tree = ET.ElementTree(file=path)
    root = tree.getroot()
    XML.chk_label(root, sizeThreshDict)
    XML.chag_size(root, filename, width, height)
    XML.chag_filename(root, filename)
    XML.thresh_size(root, width, sizeThreshDict)
    XML.write_xml(tree, path)
Пример #2
0
def regular_xml(path, filename):
    global count
    if os.path.exists(path):
        tree = ET.ElementTree(file=path)
        root = tree.getroot()
        # XML.chag_label(root,labelDict) # 修改label名称
        # root=XML.del_tag(root,names) # 删除指定label
        # root=XML.save_tag(root,names) # 只保留指定label
        XML.thresh_size(root, width, sizeThreshDict)
        XML.write_xml(tree, path)