view MoinMoin/jabber/ @ 2070:4e123eb32380

Handle inbound xmlrpc traffic, send notifications. This is only a beginning. ;)
author Karol 'grzywacz' Nowak <>
date Thu, 31 May 2007 21:23:16 +0200
parents 7e2a9b7d2bc6
children aa761813d7bd
line wrap: on
line source

# -*- coding: iso-8859-1 -*-
    MoinMoin - jabber bot main file

    This is a bot for notification and simple editing
    operations. Developed as a Google Summer of Code 

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

import sys
import os

from config import Config
from xmppbot import XMPPBot
from xmlrpcbot import XMLRPCServer, XMLRPCClient
from Queue import Queue

if __name__ == "__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(Config, commands_from_xmpp, commands_to_xmpp)
        xmlrpc_client = XMLRPCClient(Config, commands_from_xmpp)
        xmlrpc_server = XMLRPCServer(Config, commands_to_xmpp)
    except KeyboardInterrupt, i:
        print i