From 8db2d6900007f60fc8ab9712761c40bb950b9b52 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Thu, 4 Dec 2008 13:23:29 -0700 Subject: [PATCH] Initial template for commitbot. Saving work. --- commitbot.py | 28 ++++++++++++++++++++++++++++ commitbot.tac.example | 3 +++ 2 files changed, 31 insertions(+) create mode 100644 commitbot.py create mode 100644 commitbot.tac.example diff --git a/commitbot.py b/commitbot.py new file mode 100644 index 0000000..a21ab87 --- /dev/null +++ b/commitbot.py @@ -0,0 +1,28 @@ +from twisted.words.xish import domish +from wokkel.subprotocols import XMPPHandler +from wokkel.xmppim import AvailablePresence, Presence + +NS_MUC = 'http://jabber.org/protocol/muc' + +class CommitBot(XMPPHandler): + + def __init__(self, room, nick): + XMPPHandler.__init__(self) + + self.room = room + self.nick = nick + self.joined = False + + def connectionMade(self): + self.send(AvailablePresence()) + + # add handlers + + # join room + pres = Presence() + pres['to'] = self.room + '/' + self.nick + pres.addElement((NS_MUC, 'x')) + + + + diff --git a/commitbot.tac.example b/commitbot.tac.example new file mode 100644 index 0000000..66b4d1f --- /dev/null +++ b/commitbot.tac.example @@ -0,0 +1,3 @@ +# -*- mode: python -*- + +from twisted.application import service