예제 #1
0
    def connectionMade(self):
        """
        Called when a telnet session is established
        """
        self.factory.myprotocol = self  #bogus hack
        self.hostname = self.factory.hostname
        log.info("connected to device %s" % self.hostname)
        self.startTimeout(self.factory.loginTimeout, self.loginTimeout)
        self.protocol = telnet.TelnetProtocol()

        if not self.factory.username:
            # It's possible to go straight to the password prompt.
            self.mode = 'Password'
예제 #2
0
 def test_interface(self):
     """
     L{telnet.TelnetProtocol} implements L{telnet.ITelnetProtocol}
     """
     p = telnet.TelnetProtocol()
     verifyObject(telnet.ITelnetProtocol, p)