view jabberbot/ @ 2121:ae2134211ac1

XMPP -> wiki XML RPC, the beginning...
author Karol 'grzywacz' Nowak <>
date Thu, 14 Jun 2007 01:19:20 +0200
parents a4d95b9d8f37
children 01f05e74aa9c 4b4868ae88f0
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - jabber bot main file

    @copyright: 2007 by Karol Nowak <>
    @license: GNU GPL, see COPYING for details.

import sys
import os
from Queue import Queue

from jabberbot.config import BotConfig
from jabberbot.xmppbot import XMPPBot
from jabberbot.xmlrpcbot import XMLRPCServer, XMLRPCClient

def main():
    args = sys.argv
    if "--help" in args:
        print """MoinMoin notification bot
        Usage: %(myname)s [--server server] [--xmpp_port port] [--user user] [--resource resource] [--password pass] [--xmlrpc_host host] [--xmlrpc_port port]
        """ % { "myname": os.path.basename(args[0]) }
        raise SystemExit
    # TODO: actually accept options from the help string

    commands_from_xmpp = Queue()
    commands_to_xmpp = Queue()
        xmpp_bot = XMPPBot(BotConfig, commands_from_xmpp, commands_to_xmpp)
        xmlrpc_client = XMLRPCClient(BotConfig, commands_from_xmpp, commands_to_xmpp)
        xmlrpc_server = XMLRPCServer(BotConfig, commands_to_xmpp)
    except KeyboardInterrupt, i:
        print i

if __name__ == "__main__": main()