aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2010-01-15 01:18:56 +0100
committerSebastian Pipping <sebastian@pipping.org>2010-01-15 01:37:10 +0100
commitf3c4dc76ff8c950f39dfff80bd47144e1ba2420f (patch)
treed0a0bfbb0314d1639289bbebacd5a54910daacbd /layman/overlays/overlay.py
parentRemove format and category data from test case XML (diff)
downloadoverlord-f3c4dc76ff8c950f39dfff80bd47144e1ba2420f.tar.gz
overlord-f3c4dc76ff8c950f39dfff80bd47144e1ba2420f.tar.bz2
overlord-f3c4dc76ff8c950f39dfff80bd47144e1ba2420f.zip
Include feed URIs in overlay info display
Diffstat (limited to 'layman/overlays/overlay.py')
-rw-r--r--layman/overlays/overlay.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 93cf009..60ffadd 100644
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -188,6 +188,9 @@ class Overlay(object):
else:
self.homepage = None
+ self.feeds = [ensure_unicode(e.text.strip()) for e in xml.findall('feed')]
+
+
def __eq__(self, other):
for i in ('description', 'homepage', 'name', 'owner_email',
'owner_name', 'priority', 'status'):
@@ -240,6 +243,11 @@ class Overlay(object):
# NOTE: Two loops on purpose so the
# hooks are called with all sources in
i.to_xml_hook(repo)
+ for i in self.feeds:
+ feed = ET.Element('feed')
+ feed.text = i
+ repo.append(feed)
+ del feed
return repo
def add(self, base, quiet = False):
@@ -325,10 +333,16 @@ class Overlay(object):
link = self.homepage
link = re.compile(u' +').sub(u' ', link)
link = re.compile(u'\n ').sub(u'\n', link)
- result += u'\nLink:\n'
+ result += u'\nLink:'
result += u'\n '.join((u'\n' + link).split(u'\n'))
result += u'\n'
+ if self.feeds:
+ result += u'\n%s:' % ((len(self.feeds) == 1) and "Feed" or "Feeds")
+ for i in self.feeds:
+ result += u'\n %s' % i
+ result += u'\n'
+
return self._encode(result)
def short_list(self, width = 0):