From e7773dee5669e65afbecc9f3f0a14497e7d6d5a5 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Fri, 15 Jan 2010 01:38:13 +0100 Subject: Include quality indicator in overlay info display --- CHANGES | 4 +++- layman/action.py | 3 +++ layman/overlay.py | 2 ++ layman/overlays/overlay.py | 12 ++++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 3b7f8a0..5f44ecc 100644 --- a/CHANGES +++ b/CHANGES @@ -8,7 +8,9 @@ Version TODO On addition all sources will be probed until a working one is found. This should help Layman through many firewalls. - - Include feed URIs in overlay info display, i.e. layman -i + - Include more information in overlay info display (i.e. layman -i): + - quality indicator (not guarantee) + - feed URIs - Improve usage display diff --git a/layman/action.py b/layman/action.py index 323d706..2701030 100644 --- a/layman/action.py +++ b/layman/action.py @@ -277,6 +277,7 @@ class Info: * Source : https://overlays.gentoo.org/svn/dev/wrobel * Contact : nobody@gentoo.org * Type : Subversion; Priority: 10 + * Quality : experimental * * Description: * Test @@ -357,6 +358,7 @@ class List: * Source : https://overlays.gentoo.org/svn/dev/wrobel * Contact : nobody@gentoo.org * Type : Subversion; Priority: 10 + * Quality : experimental * * Description: * Test @@ -368,6 +370,7 @@ class List: * Source : rsync://gunnarwrobel.de/wrobel-stable * Contact : nobody@gentoo.org * Type : Rsync; Priority: 50 + * Quality : experimental * * Description: * A collection of ebuilds from Gunnar Wrobel [wrobel@gentoo.org]. diff --git a/layman/overlay.py b/layman/overlay.py index f44c250..0ea11f0 100644 --- a/layman/overlay.py +++ b/layman/overlay.py @@ -166,6 +166,7 @@ class Overlays: Source : https://overlays.gentoo.org/svn/dev/wrobel Contact : nobody@gentoo.org Type : Subversion; Priority: 10 + Quality : experimental Description: Test @@ -175,6 +176,7 @@ class Overlays: Source : rsync://gunnarwrobel.de/wrobel-stable Contact : nobody@gentoo.org Type : Rsync; Priority: 50 + Quality : experimental Description: A collection of ebuilds from Gunnar Wrobel [wrobel@gentoo.org]. diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py index 60ffadd..179123c 100644 --- a/layman/overlays/overlay.py +++ b/layman/overlays/overlay.py @@ -63,6 +63,9 @@ OVERLAY_TYPES = dict((e.type_key, e) for e in ( DarcsOverlay )) +QUALITY_LEVELS = 'core|stable|testing|experimental|graveyard'.split('|') + + #=============================================================================== # # Class Overlay @@ -174,6 +177,11 @@ class Overlay(object): else: self.status = None + self.quality = u'experimental' + if 'quality' in xml.attrib: + if xml.attrib['quality'] in set(QUALITY_LEVELS): + self.quality = ensure_unicode(xml.attrib['quality']) + if 'priority' in xml.attrib: self.priority = int(xml.attrib['priority']) else: @@ -214,6 +222,7 @@ class Overlay(object): repo = ET.Element('repo') if self.status != None: repo.attrib['status'] = self.status + repo.attrib['quality'] = self.quality repo.attrib['priority'] = str(self.priority) name = ET.Element('name') name.text = self.name @@ -294,6 +303,7 @@ class Overlay(object): Source : https://overlays.gentoo.org/svn/dev/wrobel Contact : nobody@gentoo.org Type : Subversion; Priority: 10 + Quality : experimental Description: Test @@ -321,6 +331,8 @@ class Overlay(object): else: result += u'\nType : ' + '/'.join(sorted(set(e.type for e in self.sources))) result += u'; Priority: ' + str(self.priority) + u'\n' + result += u'Quality : ' + self.quality + u'\n' + description = self.description description = re.compile(u' +').sub(u' ', description) -- cgit v1.2.3-1-g7c22