diff options
author | kongr45gpen <electrovesta@gmail.com> | 2016-03-17 20:40:21 +0200 |
---|---|---|
committer | kongr45gpen <electrovesta@gmail.com> | 2016-03-17 20:40:21 +0200 |
commit | 4c7f3a6e15562721e64e9fdad294aa156ab561f4 (patch) | |
tree | 25566b40cb0ba75e614b452a27cce35486611dd5 /local | |
parent | 1d3ba9f629c8d124b96f7c9e42374bcb6d5e7f2c (diff) | |
download | supybot_github-4c7f3a6e15562721e64e9fdad294aa156ab561f4.tar.gz supybot_github-4c7f3a6e15562721e64e9fdad294aa156ab561f4.tar.bz2 supybot_github-4c7f3a6e15562721e64e9fdad294aa156ab561f4.zip |
Add support for github ping events
Diffstat (limited to 'local')
-rw-r--r-- | local/handler/GithubHandler.py | 3 | ||||
-rw-r--r-- | local/handler/PingHandler.py | 7 | ||||
-rw-r--r-- | local/theme/DefaultTheme.py | 6 |
3 files changed, 16 insertions, 0 deletions
diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py index 07665fa..8788ea3 100644 --- a/local/handler/GithubHandler.py +++ b/local/handler/GithubHandler.py @@ -26,6 +26,7 @@ import supybot.callbacks as callbacks from ..utility import * +import PingHandler import PushHandler import WikiHandler import IssueHandler @@ -165,6 +166,8 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): IssueHandler.handle(data, theme) elif 'ref_type' in data: CreateDeleteHandler.handle(data, theme) + elif 'zen' in data: + PingHandler.handle(data, theme) elif 'message' in data: MessageHandler.handle(data, theme) else: diff --git a/local/handler/PingHandler.py b/local/handler/PingHandler.py new file mode 100644 index 0000000..81628dc --- /dev/null +++ b/local/handler/PingHandler.py @@ -0,0 +1,7 @@ +from ..utility import * + +def handle(data, theme): + theme.ping( + message = data['zen'], + zen = not configValue('allowArbitraryMessages') + ) diff --git a/local/theme/DefaultTheme.py b/local/theme/DefaultTheme.py index 2a17845..36166dd 100644 --- a/local/theme/DefaultTheme.py +++ b/local/theme/DefaultTheme.py @@ -163,6 +163,12 @@ class DefaultTheme(Theme): message )) + def ping(self, message, zen): + self.msgs.append( "%s: %s" % ( + self.repo("zen" if zen else None), + ircutils.mircColor(message, "light blue") + )) + def unknown(self, eventType): self.msgs.append( "%s: %s happened" % ( self.repo(), |