Store the parsed variants for possible later re-use
Merges: https://pagure.io/pungi/pull-request/1257 Signed-off-by: Pat Riehecky <riehecky@fnal.gov>
This commit is contained in:
parent
b420986aa4
commit
a99bf8c828
@ -60,6 +60,7 @@ class VariantsXmlParser(object):
|
|||||||
with open(get_variants_dtd(logger), 'r') as f:
|
with open(get_variants_dtd(logger), 'r') as f:
|
||||||
self.dtd = lxml.etree.DTD(f)
|
self.dtd = lxml.etree.DTD(f)
|
||||||
self.addons = {}
|
self.addons = {}
|
||||||
|
self.variants = {}
|
||||||
self.layered_products = {}
|
self.layered_products = {}
|
||||||
self.tree_arches = tree_arches
|
self.tree_arches = tree_arches
|
||||||
self.tree_variants = tree_variants
|
self.tree_variants = tree_variants
|
||||||
@ -228,14 +229,13 @@ class VariantsXmlParser(object):
|
|||||||
variant_id = str(variant_node.attrib["id"])
|
variant_id = str(variant_node.attrib["id"])
|
||||||
self.addons[variant_id] = variant_node
|
self.addons[variant_id] = variant_node
|
||||||
|
|
||||||
result = {}
|
|
||||||
for variant_node in self.tree.xpath("/variants/variant[@type='variant']"):
|
for variant_node in self.tree.xpath("/variants/variant[@type='variant']"):
|
||||||
variant = self.parse_variant_node(variant_node)
|
variant = self.parse_variant_node(variant_node)
|
||||||
if not variant or self._is_excluded(variant):
|
if not variant or self._is_excluded(variant):
|
||||||
continue
|
continue
|
||||||
result[variant.id] = variant
|
self.variants[variant.id] = variant
|
||||||
|
|
||||||
return result
|
return self.variants
|
||||||
|
|
||||||
|
|
||||||
class Variant(object):
|
class Variant(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user