[gnome-ostree] bot: Reword the message and colorize depending on the build status



commit 2d8059bb91c18ade44f17194aecda56968442ab4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Oct 30 12:50:17 2012 +0000

    bot: Reword the message and colorize depending on the build status
    
    Should make visually scanning for build status a tad easier.
    
    Signed-off-by: Emmanuele Bassi <ebassi gnome org>
    Signed-off-by: Colin Walters <walters verbum org>

 qa/supybot/GNOMEOSTree/plugin.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/qa/supybot/GNOMEOSTree/plugin.py b/qa/supybot/GNOMEOSTree/plugin.py
index 7452712..51cf7dc 100644
--- a/qa/supybot/GNOMEOSTree/plugin.py
+++ b/qa/supybot/GNOMEOSTree/plugin.py
@@ -86,18 +86,23 @@ class GNOMEOSTree(callbacks.Plugin):
             if status and builds[-1]['state'] == 'running':
                 building = builds[-1]
                 msg = "Active build: %s; %s" % (building['build-status']['description'], msg)
-        msg += " %s: %s" % (version, latest['state'])
+        msg += " %s: %s." % (version, latest['state'])
         diff = latest['diff']
         if len(diff[0]) > 0:
-            msg += " Added modules: %s" % (', '.join(diff[0]), )
+            msg += " Latest added modules: %s." % (', '.join(diff[0]), )
         if len(diff[1]) > 0:
-            msg += " Updated modules: %s" % (', '.join(diff[1]), )
+            msg += " Latest updated modules: %s." % (', '.join(diff[1]), )
         if len(diff[2]) > 0:
-            msg += " Removed modules: %s" % (', '.join(diff[2]), )
+            msg += " Latest removed modules: %s." % (', '.join(diff[2]), )
 
         msg += " http://ostree.gnome.org/work/tasks/%s-build/%s/log"; % (data['prefix'],
                                                                         latest['v'])
 
+        if latest['state'] == 'failed':
+            msg = ircutils.mircColor(msg, fg='red')
+        elif latest['state'] == 'success':
+            msg = ircutils.mircColor(msg, fg='green')
+
         self._broadcast(msg)
 
     def buildstatus(self, irc, msg, args):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]