1 |
commit: 63133f019f13c20b5ce9d6029a1899daae4cc452 |
2 |
Author: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Feb 5 18:34:28 2011 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Sat Feb 5 18:34:28 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/overlord.git;a=commit;h=63133f01 |
7 |
|
8 |
add an irc data element to the overlay xml |
9 |
|
10 |
--- |
11 |
overlord/api.py | 1 + |
12 |
overlord/overlays/overlay.py | 13 +++++++++++++ |
13 |
2 files changed, 14 insertions(+), 0 deletions(-) |
14 |
|
15 |
diff --git a/overlord/api.py b/overlord/api.py |
16 |
index 936af9b..0fe9362 100644 |
17 |
--- a/overlord/api.py |
18 |
+++ b/overlord/api.py |
19 |
@@ -212,6 +212,7 @@ class OverlordAPI(object): |
20 |
'owner_name': overlay.owner_name, |
21 |
'owner_email': overlay.owner_email, |
22 |
'homepage': overlay.homepage, |
23 |
+ 'irc': overlay.irc, |
24 |
'description': overlay.description, |
25 |
#'src_uris': [e.src for e in overlay.sources], |
26 |
'src_uris': overlay.source_uris(), |
27 |
|
28 |
diff --git a/overlord/overlays/overlay.py b/overlord/overlays/overlay.py |
29 |
index 4a3cae7..e8730f9 100644 |
30 |
--- a/overlord/overlays/overlay.py |
31 |
+++ b/overlord/overlays/overlay.py |
32 |
@@ -210,6 +210,12 @@ class Overlay(object): |
33 |
|
34 |
self.feeds = [ensure_unicode(strip_text(e)) for e in xml.findall('feed')] |
35 |
|
36 |
+ _irc = xml.find('irc') |
37 |
+ if _irc != None: |
38 |
+ self.irc = ensure_unicode(strip_text(_irc)) |
39 |
+ else: |
40 |
+ self.irc = None |
41 |
+ |
42 |
|
43 |
def __eq__(self, other): |
44 |
for i in ('description', 'homepage', 'name', 'owner_email', |
45 |
@@ -249,6 +255,10 @@ class Overlay(object): |
46 |
homepage = ET.Element('homepage') |
47 |
homepage.text = self.homepage |
48 |
repo.append(homepage) |
49 |
+ if self.irc != None: |
50 |
+ irc = ET.Element('irc') |
51 |
+ irc.text = self.irc |
52 |
+ repo.append(irc) |
53 |
owner = ET.Element('owner') |
54 |
repo.append(owner) |
55 |
owner_email = ET.Element('email') |
56 |
@@ -354,6 +364,9 @@ class Overlay(object): |
57 |
result += u'\n '.join((u'\n' + link).split(u'\n')) |
58 |
result += u'\n' |
59 |
|
60 |
+ if self.irc != None: |
61 |
+ result += u'\nIRC : ' + self.irc + u'\n' |
62 |
+ |
63 |
if self.feeds: |
64 |
result += u'\n%s:' % ((len(self.feeds) == 1) and "Feed" or "Feeds") |
65 |
for i in self.feeds: |