--- a/hooks-queue.py Wed Aug 24 11:20:12 2016 +0800
+++ b/hooks-queue.py Wed Aug 24 11:53:51 2016 +0800
class GithubHookHandler(BaseHookHandler):
+ event = self.request.headers.get('X-GitHub-Event')
+ getattr(self, 'handle_' + event, self.unknown_event)()
+ self.finish({'result': 'pong'})
payload = json.loads(self.request.body)
'url': payload['repository']['html_url'],
+ def unknown_event(self):
+ self.finish({'result': 'unknown event type'})
class CandolintHooks(Application):
def __init__(self, rconn, debug):