Package twisted :: Package manhole :: Module telnet :: Class Shell
[frames | no frames]

Class Shell

BaseProtocol --+        
               |        
        Protocol --+    
                   |    
              Telnet --+
                       |
                      Shell


A Python command-line shell.
Method Summary
  checkUserAndPass(self, username, password)
  connectionMade(self)
I will write a welcomeMessage and loginPrompt to the client.
  doCommand(self, cmd)
  loggedIn(self)
Called after the user succesfully logged in.
  telnet_Command(self, cmd)
The default 'command processing' mode.
  write(self, data)
Write some data to the transport.
    Inherited from Telnet
  dataReceived(self, data)
Called whenever data is received.
  iac_DO(self, feature)
  iac_DONT(self, feature)
  iac_IP(self, feature)
  iac_WILL(self, feature)
  iac_WONT(self, feature)
  iacSBchunk(self, chunk)
  loginPrompt(self)
Override me to return a 'login:'-type prompt.
  processChunk(self, chunk)
I take a chunk of data and delegate out to telnet_* methods by way of processLine.
  processLine(self, line)
I call a method that looks like 'telnet_*' where '*' is filled in by the current mode.
  telnet_Password(self, paswd)
I accept a password as an argument, and check it with the checkUserAndPass method.
  telnet_User(self, user)
I take a username, set it to the 'self.username' attribute, print out a password prompt, and switch to 'Password' mode.
  welcomeMessage(self)
Override me to return a string which will be sent to the client before login.
    Inherited from Protocol
  connectionFailed(self)
(Deprecated)
  connectionLost(self, reason)
Called when the connection is shut down.
    Inherited from BaseProtocol
  makeConnection(self, transport)
Make a connection to a transport and a server.

Class Variable Summary
    Inherited from Telnet
str buffer = ''
list delimiters = ['\r\n', '\r\x00']
int echo = 0                                                                     
int gotIAC = 0                                                                     
NoneType iacByte = None                                                                  
NoneType lastLine = None                                                                  
str mode = 'User'
    Inherited from Protocol
tuple __implements__ = (<class twisted.internet.interfaces.IPr...
    Inherited from BaseProtocol
int connected = 0                                                                     
NoneType transport = None                                                                  

Method Details

connectionMade(self)

I will write a welcomeMessage and loginPrompt to the client.
Overrides:
twisted.protocols.telnet.Telnet.connectionMade (inherited documentation)

loggedIn(self)

Called after the user succesfully logged in.

Override in subclasses.
Overrides:
twisted.protocols.telnet.Telnet.loggedIn (inherited documentation)

telnet_Command(self, cmd)

The default 'command processing' mode. You probably want to override me.
Overrides:
twisted.protocols.telnet.Telnet.telnet_Command (inherited documentation)

write(self, data)

Write some data to the transport.
Overrides:
twisted.protocols.telnet.Telnet.write

Generated by Epydoc 2.0 on Sat May 15 20:08:25 2004 http://epydoc.sf.net