From 8b9f59ba944eb5291e8700c1af24310d22857e23 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Wed, 7 Dec 2016 19:35:39 +0200 Subject: Add support for AppVeyor notifications Implements #12 --- local/handler/AppVeyorHandler.py | 13 +++++++++++++ local/handler/GithubHandler.py | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 local/handler/AppVeyorHandler.py (limited to 'local') diff --git a/local/handler/AppVeyorHandler.py b/local/handler/AppVeyorHandler.py new file mode 100644 index 0000000..f60fece --- /dev/null +++ b/local/handler/AppVeyorHandler.py @@ -0,0 +1,13 @@ +from ..utility import * + +def handle(data, theme): + if isStatusVisible(data['eventData']['projectId'], data['eventData']['status'].lower()): + theme.travis( + branch = data['eventData']['branch'], + repo = data['eventData']['repositoryName'].split('/')[1], + status = data['eventData']['status'], + commitId = data['eventData']['commitId'], + commitMessage = data['eventData']['commitMessage'], + commitAuthor = data['eventData']['commitAuthor'], + buildUrl = getShortURL(data['eventData']['buildUrl']) + ) diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py index 6b2dd30..ce6edd2 100644 --- a/local/handler/GithubHandler.py +++ b/local/handler/GithubHandler.py @@ -35,6 +35,7 @@ import StatusHandler import TravisHandler import MessageHandler import ReleaseHandler +import AppVeyorHandler import CreateDeleteHandler import IssueCommentHandler @@ -178,6 +179,8 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): PingHandler.handle(data, theme) elif 'message' in data: MessageHandler.handle(data, theme) + elif 'eventName' in data: + AppVeyorHandler.handle(data, theme) else: theme.unknown(eventType) -- cgit v1.2.3