diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-06 14:00:40 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-06 14:00:40 -0700 |
commit | 13feb999d3ab6af4a66734471a9795d7450fa945 (patch) | |
tree | f32909dfd8a441689cd979061e00372853063503 | |
parent | eaf6feffad49a52f3d37eeb530b23b13e7f3e994 (diff) | |
download | portage-13feb999d3ab6af4a66734471a9795d7450fa945.tar.gz portage-13feb999d3ab6af4a66734471a9795d7450fa945.tar.bz2 portage-13feb999d3ab6af4a66734471a9795d7450fa945.zip |
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.
-rw-r--r-- | pym/portage/xml/metadata.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 |