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