diff options
author | kongr45gpen <electrovesta@gmail.com> | 2016-02-07 14:55:01 +0200 |
---|---|---|
committer | kongr45gpen <electrovesta@gmail.com> | 2016-02-07 14:55:01 +0200 |
commit | 8f12dc15155e6de248a0ab73058f64e3f8f6a1e6 (patch) | |
tree | 2318f2624d11ae0823ec7d3f6dff54267558534e | |
parent | 1ce4ba221a305d5f8ebe3dc75c60f2ad5e895202 (diff) | |
download | supybot_github-8f12dc15155e6de248a0ab73058f64e3f8f6a1e6.tar.gz supybot_github-8f12dc15155e6de248a0ab73058f64e3f8f6a1e6.tar.bz2 supybot_github-8f12dc15155e6de248a0ab73058f64e3f8f6a1e6.zip |
Add compact theme for travis builds
-rw-r--r-- | local/handler/GithubHandler.py | 4 | ||||
-rw-r--r-- | 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 + )) + )) |