From: Zac Medico Date: Mon, 6 Sep 2010 21:00:40 +0000 (-0700) Subject: Add an optional herdstree parameter to the MetaDataXML constructor, X-Git-Tag: v2.2_rc76~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=13feb999d3ab6af4a66734471a9795d7450fa945;p=portage.git Add an optional herdstree parameter to the MetaDataXML constructor, in case the caller has already parsed herds.xml. This allows the caller to parse herds.xml once an re-use the same ElementTree instance for many different MetaDataXML instances. --- diff --git a/pym/portage/xml/metadata.py b/pym/portage/xml/metadata.py index 70208f844..ca523e4f1 100644 --- a/pym/portage/xml/metadata.py +++ b/pym/portage/xml/metadata.py @@ -159,7 +159,7 @@ class _Upstream(object): class MetaDataXML(object): """Access metadata.xml""" - def __init__(self, metadata_xml_path, settings=None): + def __init__(self, metadata_xml_path, settings=None, herdstree=None): """Parse a valid metadata.xml file. @type metadata_xml_path: str @@ -180,7 +180,7 @@ class MetaDataXML(object): pass # Used for caching - self._herdstree = None + self._herdstree = herdstree self._descriptions = None self._maintainers = None self._herds = None