commitbot/commitbot.tac.example

25 lines
681 B
Python

# -*- mode: python -*-
from twisted.application import service, internet
from twisted.web import server
from twisted.words.protocols.jabber import jid
from wokkel.client import XMPPClient
from commitbot import CommitBot, WebHook
application = service.Application('commitbot')
client = XMPPClient(jid.internJID('user@example.com'), 'password')
client.logTraffic = True
#In the next line, replace None with the password, for a protected room
bot = CommitBot('room@chat.example.com', 'gitbot', None)
bot.setHandlerParent(client)
client.setServiceParent(application)
site = server.Site(WebHook(bot))
server = internet.TCPServer(8888, site)
server.setServiceParent(application)