From 63133f019f13c20b5ce9d6029a1899daae4cc452 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sat, 5 Feb 2011 10:34:28 -0800 Subject: add an irc data element to the overlay xml --- overlord/api.py | 1 + overlord/overlays/overlay.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/overlord/api.py b/overlord/api.py index 936af9b..0fe9362 100644 --- a/overlord/api.py +++ b/overlord/api.py @@ -212,6 +212,7 @@ class OverlordAPI(object): 'owner_name': overlay.owner_name, 'owner_email': overlay.owner_email, 'homepage': overlay.homepage, + 'irc': overlay.irc, 'description': overlay.description, #'src_uris': [e.src for e in overlay.sources], 'src_uris': overlay.source_uris(), diff --git a/overlord/overlays/overlay.py b/overlord/overlays/overlay.py index 4a3cae7..e8730f9 100644 --- a/overlord/overlays/overlay.py +++ b/overlord/overlays/overlay.py @@ -210,6 +210,12 @@ class Overlay(object): self.feeds = [ensure_unicode(strip_text(e)) for e in xml.findall('feed')] + _irc = xml.find('irc') + if _irc != None: + self.irc = ensure_unicode(strip_text(_irc)) + else: + self.irc = None + def __eq__(self, other): for i in ('description', 'homepage', 'name', 'owner_email', @@ -249,6 +255,10 @@ class Overlay(object): homepage = ET.Element('homepage') homepage.text = self.homepage repo.append(homepage) + if self.irc != None: + irc = ET.Element('irc') + irc.text = self.irc + repo.append(irc) owner = ET.Element('owner') repo.append(owner) owner_email = ET.Element('email') @@ -354,6 +364,9 @@ class Overlay(object): result += u'\n '.join((u'\n' + link).split(u'\n')) result += u'\n' + if self.irc != None: + result += u'\nIRC : ' + self.irc + u'\n' + if self.feeds: result += u'\n%s:' % ((len(self.feeds) == 1) and "Feed" or "Feeds") for i in self.feeds: -- cgit v1.2.3-65-gdbad