expose name/version from metadata class

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2017-01-31 22:41:45 +01:00
parent 4ff91cb101
commit e2f321d603

View file

@ -31,6 +31,8 @@ class Dependency(object):
class Metadata(object): class Metadata(object):
def __init__(self, path): def __init__(self, path):
self.name = None
self.version = None
self._provides = [] self._provides = []
self._requires = [] self._requires = []
self._conflicts = [] self._conflicts = []
@ -83,8 +85,8 @@ class Metadata(object):
def _parse_metadata(self, metadata): def _parse_metadata(self, metadata):
md = metadata["packages"][0] md = metadata["packages"][0]
name = md["name"] self.name = md["name"]
version = semver.SpecItem("={}".format(md["version"])) self.version = semver.SpecItem("={}".format(md["version"]))
# Provides # Provides
self._provides = [Dependency(name, version)] self._provides = [Dependency(name, version)]