comparison MoinMoin/jabber/main.py @ 2068:7e2a9b7d2bc6

XML RPC functionality for the notification bot - the beginning
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Thu, 31 May 2007 01:19:49 +0200
parents 3ca2b7065a05
children 4e123eb32380
comparison
equal deleted inserted replaced
2067:3ca2b7065a05 2068:7e2a9b7d2bc6
4 4
5 This is a bot for notification and simple editing 5 This is a bot for notification and simple editing
6 operations. Developed as a Google Summer of Code 6 operations. Developed as a Google Summer of Code
7 project. 7 project.
8 8
9 @copyright: 2007 by Karol Nowak <grywacz@gmail.com> 9 @copyright: 2007 by Karol Nowak <grywacz@gmail.com>
10 @license: GNU GPL, see COPYING for details. 10 @license: GNU GPL, see COPYING for details.
11 """ 11 """
12 12
13 import sys 13 import sys
14 from config import JabberConfig 14 from config import JabberConfig
15 from xmppbot import XMPPBot 15 from xmppbot import XMPPBot
16 from xmlrpcbot import XMLRPCServer, XMLRPCClient
16 from Queue import Queue 17 from Queue import Queue
17 18
18 def main(): 19 def main():
19 commands = Queue() 20 commands_from_xmpp = Queue()
20 results = Queue() 21 commands_to_xmpp = Queue()
21 22
22 try: 23 try:
23 bot = XMPPBot(JabberConfig, commands, results) 24 xmpp_bot = XMPPBot(JabberConfig, commands_from_xmpp, commands_to_xmpp)
24 bot.start() 25 xmlrpc_client = XMLRPCClient(commands_from_xmpp)
26 xmlrpc_server = XMLRPCServer(commands_to_xmpp)
27
28 xmpp_bot.start()
29 xmlrpc_client.start()
30 xmlrpc_server.start()
25 31
26 except KeyboardInterrupt, i: 32 except KeyboardInterrupt, i:
27 print i 33 print i
28 sys.exit(0) 34 sys.exit(0)
29 35