Hello Alvin,<br><br>Thanks, MSNP8 should be enough for a chat bot. I'll have a look at the <a href="http://twisted.im">twisted.im</a> module, it seems to contain a basic multi-protocol chat client.<br><br>I had another question about the Jabber example (xmpp_client.py) in Twisted words. When I quit the application with Ctrl+C, it throws an exception:<br>
<br>Disconnected.<br>Traceback (most recent call last):<br> File "/usr/lib/python2.5/site-packages/twisted/internet/posixbase.py", line 228, in mainLoop<br> self.runUntilCurrent()<br> File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 561, in runUntilCurrent<br>
call.func(*call.args, **<a href="http://call.kw">call.kw</a>)<br> File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 414, in _continueSystemEvent<br> callable(*args, **kw)<br> File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 375, in disconnectAll<br>
failure.Failure(main.CONNECTION_LOST))<br>--- <exception caught here> ---<br> File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 48, in callWithLogger<br> return callWithContext({"system": lp}, func, *args, **kw)<br>
File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 33, in callWithContext<br> return context.call({ILogContext: newCtx}, func, *args, **kw)<br> File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 59, in callWithContext<br>
return self.currentContext().callWithContext(ctx, func, *args, **kw)<br> File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 37, in callWithContext<br> return func(*args,**kw)<br> File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py", line 576, in connectionLost<br>
Connection.connectionLost(self, reason)<br> File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py", line 416, in connectionLost<br> protocol.connectionLost(reason)<br> File "/usr/lib/python2.5/site-packages/twisted/words/xish/xmlstream.py", line 82, in connectionLost<br>
self.dispatch(self, STREAM_END_EVENT)<br> File "/usr/lib/python2.5/site-packages/twisted/words/xish/utility.py", line 227, in dispatch<br> self._eventObservers[(priority, event)].callback(object)<br> File "/usr/lib/python2.5/site-packages/twisted/words/xish/utility.py", line 37, in callback<br>
methodwrapper(*args, **kwargs)<br> File "/usr/lib/python2.5/site-packages/twisted/words/xish/utility.py", line 21, in __call__<br> self.method(*nargs, **nkwargs)<br> File "xmpp_client.py", line 58, in disconnected<br>
reactor.stop()<br> File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 342, in stop<br> raise RuntimeError, "can't stop reactor that isn't running"<br>exceptions.RuntimeError: can't stop reactor that isn't running<br>
<br>Is there any way to modify this example so that it stops gracefully when Ctrl+C is pressed? Embedding the main script code in a try-except statement that catches KeyboardInterrupt doesn't help since Twisted seems to catch all exceptions itself.<br>
<br>I read about deferred's and errbacks, but I don't know where to add an errback to in the XMPP example. To the client? The XmlStream? The reactor?<br><br>Any pointers would be greatly appreciated ...<br><br>Thanks!<br>
<br>-- Jo<br><br><div class="gmail_quote">On Mon, May 26, 2008 at 2:37 PM, Alvin Delagon <<a href="mailto:adelagon@gmail.com">adelagon@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There's a twisted MSNP8 (or is it MSNP9) implementation. It's experimental but it works. I managed to write an MSN gateway for XMPP deriving most of the codes from it.<br><br>----<br>Alvin Delagon<br><br><div class="gmail_quote">
<div><div></div><div class="Wj3C7c">
On Mon, May 26, 2008 at 6:49 PM, Jo Vermeulen <<a href="mailto:jo.vermeulen@gmail.com" target="_blank">jo.vermeulen@gmail.com</a>> wrote:<br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">
Hello,<br><br>I am trying to create a chat bot that can work over both the XMPP and the MSN protocol using Twisted words. I have a couple of questions as a Twisted newbie :-)<br><br>Is there any documentation on how to create a protocol-agnostic chatbot with Twisted words? Or are there applications using Twisted words that offer multiple front-ends?<br>
<br>I have a XMPP version working, but had some problems finding my way around a few features. I don't know how to get a list of contacts, or initiatiate a group chat. Even if I succeed in doing this, would it be possible to generalize this for both XMPP and MSN?<br>
<br>Finally, I was wondering how mature Twisted words is. It seems to work well for XMPP, but how mature is the MSN support? Are there other libraries I could consider, or is it possible to generalize other libraries within Twisted?<br>
<br>Thanks in advance!<br><font color="#888888"><br>-- Jo Vermeulen<br>
</font><br></div></div>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br><a href="http://www.alvinatorsplayground.blogspot.com/" target="_blank">http://www.alvinatorsplayground.blogspot.com/</a>
</font><br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br>