mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +00:00
Removed unused xmlcompare.py.
This commit is contained in:
parent
22134c302b
commit
5da7bd1866
1 changed files with 0 additions and 28 deletions
|
@ -1,28 +0,0 @@
|
||||||
from xml.etree import cElementTree as ET
|
|
||||||
|
|
||||||
def comparemany(xmls):
|
|
||||||
xml1 = xmls[0]
|
|
||||||
if type(xml1) == type(''):
|
|
||||||
xml1 = ET.fromstring(xml1)
|
|
||||||
for xml in xmls[1:]:
|
|
||||||
xml2 = xml
|
|
||||||
if type(xml2) == type(''):
|
|
||||||
xml2 = ET.fromstring(xml2)
|
|
||||||
if not compare(xml1, xml2): return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def compare(xml1, xml2):
|
|
||||||
if xml1.tag != xml2.tag:
|
|
||||||
return False
|
|
||||||
if xml1.attrib != xml2.attrib:
|
|
||||||
return False
|
|
||||||
for child in xml1:
|
|
||||||
child2s = xml2.findall("%s" % child.tag)
|
|
||||||
if child2s is None:
|
|
||||||
return False
|
|
||||||
found = False
|
|
||||||
for child2 in child2s:
|
|
||||||
found = compare(child, child2)
|
|
||||||
if found: break
|
|
||||||
if not found: return False
|
|
||||||
return True
|
|
Loading…
Reference in a new issue