I'm making a manhole service in the usual way: class PF(ServerProtocol): def protocolFactory(*a, **kw): return manhole.Manhole(namespace)
realm = manhole_ssh.TerminalRealm() realm.chainedProtocolFactory = PF mh_portal = portal.Portal(realm) mh_portal.registerChecker(checker) manhole_service = TCPServer(0, manhole_ssh.ConchFactory(mh_portal)) manhole_service.startService() and I'd like to print a message when the terminal is opened. This change does it: class PF(ServerProtocol): def protocolFactory(*a, **kw): class Manhole(manhole.Manhole): def connectionMade(self): super(Manhole, self).connectionMade() self.terminal.write('Hello') return manhole.Manhole(namespace) and so does this version, which is better because t.c.i.i.ServerProtocol.connectionMade says it is the place to write messages: class PF(ServerProtocol): def protocolFactory(*a, **kw): return manhole.Manhole(namespace) def connectionMade(self): ServerProtocol.connectionMade(self) self.write('Hello') But in both cases, after the message the screen is cleared by what looks like a form feed, and another prompt is printed. So far I can't find where in the code this happens. Is there a way to print a message and not have it scrolled off the screen? Thanks, Peter.
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python