diff options
author | kongr45gpen <electrovesta@gmail.com> | 2017-01-04 00:50:12 +0200 |
---|---|---|
committer | kongr45gpen <electrovesta@gmail.com> | 2017-01-04 00:50:12 +0200 |
commit | 81fc93a87a978735130cec0011ba3fb1eec90116 (patch) | |
tree | 604cf3cc0520dd946c0f56d811c1292eef1b868d | |
parent | 7f46f55d67c50f50dc51a00d2487250c4c1e5e94 (diff) | |
download | supybot_github-81fc93a87a978735130cec0011ba3fb1eec90116.tar.gz supybot_github-81fc93a87a978735130cec0011ba3fb1eec90116.tar.bz2 supybot_github-81fc93a87a978735130cec0011ba3fb1eec90116.zip |
Show force pushes even if push display is disabled
Closes #15
-rw-r--r-- | config.py | 4 | ||||
-rw-r--r-- | local/handler/GithubHandler.py | 1 | ||||
-rw-r--r-- | local/handler/PushHandler.py | 4 |
3 files changed, 8 insertions, 1 deletions
@@ -85,4 +85,8 @@ conf.registerChannelValue(Github, 'showPendingStatuses', registry.Boolean(True, """Whether to show a message for a pending status (e.g. a build in progress)""")) +conf.registerChannelValue(Github, 'alwaysShowForcedPushes', + registry.Boolean(True, + """Whether to always show force-pushes, even if hidePush is set to True""")) + # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py index ce6edd2..6a7d075 100644 --- a/local/handler/GithubHandler.py +++ b/local/handler/GithubHandler.py @@ -41,6 +41,7 @@ import IssueCommentHandler from .. import theme as themes +#TODO: Use a better name and location for this class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(s): """Respond to a POST request.""" diff --git a/local/handler/PushHandler.py b/local/handler/PushHandler.py index 13052a3..903b1b6 100644 --- a/local/handler/PushHandler.py +++ b/local/handler/PushHandler.py @@ -46,7 +46,9 @@ def handle(data, theme): regularCommitCount = len(data['commits']) - mergedCommitCount isMerge = True - if configValue("hidePush",None) == False and not branched: + visible = configValue("hidePush") == False or (configValue("alwaysShowForcedPushes") == True and data['forced']) + + if visible and not branched: theme.push( branch = branch, actor = data['pusher']['name'], |