public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/overlord:master commit in: overlord/overlays/, overlord/
@ 2011-02-05 18:35 Brian Dolbec
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2011-02-05 18:35 UTC (permalink / raw
  To: gentoo-commits

commit:     63133f019f13c20b5ce9d6029a1899daae4cc452
Author:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Sat Feb  5 18:34:28 2011 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Feb  5 18:34:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/overlord.git;a=commit;h=63133f01

add an irc data element to the overlay xml

---
 overlord/api.py              |    1 +
 overlord/overlays/overlay.py |   13 +++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

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:



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/overlord:master commit in: overlord/overlays/, overlord/
@ 2011-02-07  3:10 Brian Dolbec
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2011-02-07  3:10 UTC (permalink / raw
  To: gentoo-commits

commit:     3684c28f8f1c8a88304c538393c478a12998fe1a
Author:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Sun Feb  6 23:37:30 2011 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Feb  6 23:37:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/overlord.git;a=commit;h=3684c28f

rename Overlay's __str__().  split out UnknownOverlayMessage() from the exception class

---
 overlord/dbbase.py           |    8 +++++---
 overlord/overlays/overlay.py |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/overlord/dbbase.py b/overlord/dbbase.py
index 7821aea..e152578 100644
--- a/overlord/dbbase.py
+++ b/overlord/dbbase.py
@@ -41,10 +41,12 @@ from   overlord.overlays.overlay   import Overlay
 # Class UnknownOverlayException
 #
 #-------------------------------------------------------------------------------
+def UnknownOverlayMessage(ovl):
+    return 'Overlay "%s" does not exist.' % ovl
 
 class UnknownOverlayException(Exception):
     def __init__(self, repo_name):
-        message = 'Overlay "%s" does not exist.' % repo_name
+        UnknownOverlayMessage(repo_name)
         super(UnknownOverlayException, self).__init__(message)
 
 #===============================================================================
@@ -242,8 +244,8 @@ class DbBase:
 
         for overlay in selection:
             if verbose:
-                result.append((str(overlay), overlay.is_supported(),
-                               overlay.is_official()))
+                result.append(overlay.get_infostr(), overlay.is_supported(),
+                               overlay.is_official())
             else:
                 result.append((overlay.short_list(width), overlay.is_supported(),
                                overlay.is_official()))

diff --git a/overlord/overlays/overlay.py b/overlord/overlays/overlay.py
index e8730f9..b827fd8 100644
--- a/overlord/overlays/overlay.py
+++ b/overlord/overlays/overlay.py
@@ -305,7 +305,7 @@ class Overlay(object):
         assert len(self.sources) == 1
         return self.sources[0].delete(base)
 
-    def __str__(self):
+    def get_infostr(self):
         '''
         >>> here = os.path.dirname(os.path.realpath(__file__))
         >>> import xml.etree.ElementTree as ET # Python 2.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-07  3:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-05 18:35 [gentoo-commits] proj/overlord:master commit in: overlord/overlays/, overlord/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2011-02-07  3:10 Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox