From 8f12dc15155e6de248a0ab73058f64e3f8f6a1e6 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Sun, 7 Feb 2016 14:55:01 +0200 Subject: Add compact theme for travis builds --- local/handler/GithubHandler.py | 4 ++-- local/theme/CompactTheme.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py index 635076c..4d420e3 100644 --- a/local/handler/GithubHandler.py +++ b/local/handler/GithubHandler.py @@ -55,8 +55,8 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): eventType = '' if not world.testing: - if not os.path.exists('requests/'): - os.makedirs('requests') + if not os.path.exists('requests/'): + os.makedirs('requests') f = open('requests/' + eventType + strftime("%Y-%m-%d %H:%M:%S") + '.json', 'w') f.write(json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))) diff --git a/local/theme/CompactTheme.py b/local/theme/CompactTheme.py index cb3364d..a1090c9 100644 --- a/local/theme/CompactTheme.py +++ b/local/theme/CompactTheme.py @@ -11,3 +11,16 @@ class CompactTheme(DefaultTheme): maxLen(message.splitlines()[0], 300), self.enclose(url) )) + + def travis(self, branch, repo, status, commitId, commitMessage, commitAuthor, buildUrl): + self.msgs.append( "%s @ %s: %s %s: build %s %s" % ( + ircutils.bold(ircutils.mircColor(branch, "blue")), + ircutils.bold(repo), + ircutils.mircColor(commitAuthor, "green"), + ircutils.mircColor(commitId[0:6], "dark grey"), + colorAction(status.lower()), + self.enclose("%s - %s" % ( + ircutils.mircColor(maxLen(commitMessage, 50), "dark gray"), + buildUrl + )) + )) -- cgit v1.2.3