diff options
author | Magnus Granberg <zorry@gentoo.org> | 2021-05-02 17:20:18 +0200 |
---|---|---|
committer | Magnus Granberg <zorry@gentoo.org> | 2021-05-02 17:20:18 +0200 |
commit | 7bcbb68920519aae210f2ad3504d641743fee61f (patch) | |
tree | 1b14d69c18d469128a01caaa1afcd3bec28b6331 | |
parent | Add IRC reporter with RG support (diff) | |
download | tinderbox-cluster-7bcbb68920519aae210f2ad3504d641743fee61f.tar.gz tinderbox-cluster-7bcbb68920519aae210f2ad3504d641743fee61f.tar.bz2 tinderbox-cluster-7bcbb68920519aae210f2ad3504d641743fee61f.zip |
Add color to the output of IRC reporter
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
-rw-r--r-- | buildbot_gentoo_ci/config/reporters.py | 10 | ||||
-rw-r--r-- | buildbot_gentoo_ci/reporters/irc.py | 7 |
2 files changed, 8 insertions, 9 deletions
diff --git a/buildbot_gentoo_ci/config/reporters.py b/buildbot_gentoo_ci/config/reporters.py index cc0c656..44edeab 100644 --- a/buildbot_gentoo_ci/config/reporters.py +++ b/buildbot_gentoo_ci/config/reporters.py @@ -6,10 +6,11 @@ from buildbot.reporters.generators.build import BuildStatusGenerator from buildbot.reporters.message import MessageFormatter from buildbot_gentoo_ci.reporters import irc -#FIXME can colors be added here or is it needed in IRCStatusPush -irc_template = '''\ -Buildbot: {{ build['properties']['cpv'][0] }} repo/{{ projects }} {{ build['properties']['revision'][0] }} \ -{{ build['properties']['owners'][0] }} {{ build['properties']['project_data'][0]['name'] }} {{ summary }} {{ build_url }}\ +irc_template = '''{% set resultsList = ["\x0303SUCCESS", "\x0308WARNINGS", "\x0304FAILURE"] %}\ +Buildbot: {{ "\x02" }}{{ build['properties']['cpv'][0] }}{{ "\x02" }} {{ "\x0303" }}repo/{{ projects }}{{ "\x03" }} \ +{{ build['properties']['revision'][0]|truncate(10, True) }} {{ "\x0302" }}{{ build['properties']['owners'][0][0] }}{{ "\x03" }} \ +{{ build['properties']['project_data'][0]['name'] }} \ +{{ "\x02" }}{{ "Build: "}}{{ resultsList[build['results']] }}{{ "\x03" }}{{ "\x02" }} {{ "\x0312" }}{{ build_url }}{{ "\x03" }}\ ''' def ircGenerators(): @@ -34,7 +35,6 @@ def ircGenerators(): #FIXME: # server, nick channel should be set in config irc_reporter = irc.IRCStatusPush("irc.freenode.net", "gentoo_ci_test", - useColors=False, channels=[{"channel": "#gentoo-ci"}, ], generators=ircGenerators() diff --git a/buildbot_gentoo_ci/reporters/irc.py b/buildbot_gentoo_ci/reporters/irc.py index 86d262b..6e0bc6b 100644 --- a/buildbot_gentoo_ci/reporters/irc.py +++ b/buildbot_gentoo_ci/reporters/irc.py @@ -99,8 +99,8 @@ class IRCStatusPush(ReporterBase): def reconfigService(self, host, nick, channels, pm_to_nicks=None, port=6667, allowForce=None, tags=None, password=None, generators=None, showBlameList=True, useRevisions=False, - useSSL=False, lostDelay=None, failedDelay=None, useColors=True, - allowShutdown=None, noticeOnChannel=False, authz=None, context=None,**kwargs + useSSL=False, lostDelay=None, failedDelay=None, useColors=False, + allowShutdown=None, noticeOnChannel=False, authz=None, **kwargs ): # need to stash these so we can detect changes later @@ -162,11 +162,10 @@ class IRCStatusPush(ReporterBase): message_formatter=formatter ) ] - #FIXME: add colors and notice support + #FIXME: add notice support def sendMessage(self, reports): body = reports[0].get('body', None) print(body) - print(assembleFormattedText(A.normal[body])) for c in self.join_channels: if isinstance(c, dict): channel = c.get('channel', None) |