checksums = {}
sumtypes = {}
- for elm in root.getiterator("%sdata" % ns):
+ for elm in root.iter("%sdata" % ns):
if elm.attrib["type"] == "patterns":
filepaths['patterns'] = elm.find("%slocation" % ns).attrib['href']
checksums['patterns'] = elm.find("%sopen-checksum" % ns).text
sumtypes['patterns'] = elm.find("%sopen-checksum" % ns).attrib['type']
break
- for elm in root.getiterator("%sdata" % ns):
+ for elm in root.iter("%sdata" % ns):
#"group" type has no "open-checksum" filed, remove it.
if elm.attrib["type"] == "group_gz":
filepaths['comps'] = elm.find("%slocation" % ns).attrib['href']
break
primary_type = None
- for elm in root.getiterator("%sdata" % ns):
+ for elm in root.iter("%sdata" % ns):
if elm.attrib["type"] in ("primary_db", "primary"):
primary_type = elm.attrib["type"]
filepaths['primary'] = elm.find("%slocation" % ns).attrib['href']
ns = ns[0:ns.rindex("}")+1]
versionlist = []
- for elm in root.getiterator("%spackage" % ns):
+ for elm in root.iter("%spackage" % ns):
if elm.find("%sname" % ns).text == 'rpm':
for node in elm.getchildren():
if node.tag == "%sversion" % ns:
root = xmlparse(repo["primary"])
ns = root.getroot().tag
ns = ns[0:ns.rindex("}")+1]
- for elm in root.getiterator("%spackage" % ns):
+ for elm in root.iter("%spackage" % ns):
if elm.find("%sarch" % ns).text not in ("noarch", "src"):
arch = elm.find("%sarch" % ns).text
if arch not in archlist:
root = xmlparse(repo["primary"])
ns = root.getroot().tag
ns = ns[0:ns.rindex("}")+1]
- for elm in root.getiterator("%spackage" % ns):
+ for elm in root.iter("%spackage" % ns):
if elm.find("%sname" % ns).text == pkg and elm.find("%sarch" % ns).text in arches:
if repo["priority"] != None:
tmpprior = int(repo["priority"])
root = xmlparse(repo["primary"])
ns = root.getroot().tag
ns = ns[0:ns.rindex("}")+1]
- for elm in root.getiterator("%spackage" % ns):
+ for elm in root.iter("%spackage" % ns):
if elm.find("%sname" % ns).text == pkg_name:
if elm.find("%sarch" % ns).text != "src":
version = elm.find("%sversion" % ns)
except SyntaxError:
raise SyntaxError("%s syntax error." % comps)
- for elm in root.getiterator("group"):
+ for elm in root.iter("group"):
id = elm.find("id")
name = elm.find("name")
if id.text == group or name.text == group:
if not found:
return pkglist
- for require in elm.getiterator("packagereq"):
+ for require in elm.iter("packagereq"):
if require.tag.endswith("packagereq"):
pkgname = require.text
if pkgname not in pkglist: