ok... thanks for the help so far :)<br><br>I've managed to get it 'working' by hashing out the __init__ under the Telnet Protocol class<br><br>class TelnetProtocol(recvline.HistoricRecvLine):<br># def __init__(self, user):
<br># self.user = user<br><br>That will now allow me to connect to the 'server' but it behaves in a different way to the SSH server in that if I type in one of my commands... to see the output and return to the prompt, I have to hit enter twice which then shows me 2 prompts
:(<br><br>oh for a nice simple example like the one for SSH in the O'Reilly book :(<br><br>Andrew<br><br><div><span class="gmail_quote">On 8/8/07, <b class="gmail_sendername">Jean-Paul Calderone</b> <<a href="mailto:exarkun@divmod.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
exarkun@divmod.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, 8 Aug 2007 14:27:36 +0100, Andrew Roden <<a href="mailto:andrew.roden@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">andrew.roden@gmail.com</a>> wrote:<br>>The answer is no I wasn't running it with twistd as I didn't need to with
<br>
>the ssh one... having now run it with twistd I can see the exceptions it<br>>throws but I have absolutely no clue how to go about rectifying them :(<br>>>From what I can make out the main issue is with no terminal size being set
<br>>which from the demo_insults.tac looks like it's set in my class that deals<br>>with connections associating it with insults.TerminalProtocol (eg. class<br>>DemoProtocol(insults.TerminalProtocol): ) however, I am dealing with my
<br>>connections in recvline as I don't want it to react on a per character basis<br>>but rather a per line basis...<br>><br>>*confused of england*<br>><br>>Andrew<br>><br><br>The first traceback I see is this one:
<br><br>2007-08-08 09:46:39-0400 [twisted.internet.protocol.ServerFactory] Unhandled Error<br> Traceback (most recent call last):<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/python/log.py", line 36, in callWithContext
<br> return context.call({ILogContext: newCtx}, func, *args, **kw)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/python/context.py", line 59, in callWithContext<br> return
self.currentContext().callWithContext(ctx, func, *args, **kw)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/python/context.py", line 37, in callWithContext<br> return func(*args,**kw)
<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/selectreactor.py", line 139, in _doReadOrWrite<br> why = getattr(selectable, method)()<br> --- <exception caught here> ---
<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/tcp.py", line 813, in doRead<br> protocol.makeConnection(transport)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/protocol.py", line 333, in makeConnection
<br> self.connectionMade()<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/conch/telnet.py", line 732, in connectionMade<br> self.protocol.makeConnection(self)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/protocol.py", line 333, in makeConnection
<br> self.connectionMade()<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/conch/telnet.py", line 795, in connectionMade<br> self.protocol.makeConnection(self)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/protocol.py", line 333, in makeConnection
<br> self.connectionMade()<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/conch/insults/insults.py", line 416, in connectionMade<br> self.terminalProtocol = self.protocolFactory
(*self.protocolArgs, **self.protocolKwArgs)<br> exceptions.TypeError: __init__() takes exactly 2 arguments (1 given)<br><br>Python is really helpful here, omitting the class name which has the bad<br>__init__, but I guess you can track that down with a little effort (and
<br>there are probably only a small number of candidates).<br><br>The next one I see is this:<br><br>2007-08-08 09:46:39-0400 [TelnetTransport,0,<a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
127.0.0.1</a>] Unhandled Error<br> Traceback (most recent call last):
<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/python/log.py", line 51, in callWithLogger<br> return callWithContext({"system": lp}, func, *args, **kw)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/python/log.py", line 36, in callWithContext
<br> return context.call({ILogContext: newCtx}, func, *args, **kw)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/python/context.py", line 59, in callWithContext<br> return
self.currentContext().callWithContext(ctx, func, *args, **kw)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/python/context.py", line 37, in callWithContext<br> return func(*args,**kw)
<br> --- <exception caught here> ---<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/selectreactor.py", line 139, in _doReadOrWrite<br> why = getattr(selectable, method)()
<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/tcp.py", line 362, in doRead<br> return self.protocol.dataReceived(data)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/conch/telnet.py", line 483, in dataReceived
<br> self.negotiate(commands)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/conch/telnet.py", line 526, in negotiate<br> cmdFunc(bytes)<br> File "/home/exarkun/Projects/Twisted/trunk/twisted/conch/telnet.py", line 833, in telnet_NAWS
<br> self.protocol.terminalProtocol.terminalSize(width, height)<br> exceptions.AttributeError: 'NoneType' object has no attribute 'terminalSize'<br><br>This may just be a consequence of the first one, so I'd try resolving the
<br>first one before looking more at this.<br><br>Jean-Paul<br><br>_______________________________________________<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Twisted-Python@twistedmatrix.com
</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>
<br></blockquote></div><br>