Package twisted :: Package conch :: Package insults :: Module client :: Class InsultsClient
[frames | no frames]

Class InsultsClient

BaseProtocol --+    
               |    
        Protocol --+
                   |
                  InsultsClient


Method Summary
  __init__(self)
  clearScreen(self)
Clear the screen, and return the cursor to 0, 0.
  dataReceived(self, data)
Called whenever data is received.
  endEscape(self)
  eraseToLine(self)
Erase from the current position to the end of the line.
  eraseToScreen(self)
Erase from the current position to the end of the screen.
  gotoXY(self, x, y)
Go to a position on the screen.
  initScreen(self)
  keyReceived(self, key)
Called when the user hits a key.
  refresh(self)
Redraw the screen.
  setAttributes(self, *attrs)
Set the attributes for drawing on the screen.
  setSize(self, width, height)
  windowSizeChanged(self)
Called when the size of the window changes.
  writeCh(self, ch)
Write a character to the screen.
  writeStr(self, s)
Write a string to the screen.
    Inherited from Protocol
  connectionFailed(self)
(Deprecated)
  connectionLost(self, reason)
Called when the connection is shut down.
    Inherited from BaseProtocol
  connectionMade(self)
Called when a connection is made.
  makeConnection(self, transport)
Make a connection to a transport and a server.

Class Variable Summary
float escapeTimeout = 0.20000000000000001                                                   
    Inherited from Protocol
tuple __implements__ = (<class twisted.internet.interfaces.IPr...
    Inherited from BaseProtocol
int connected = 0                                                                     
NoneType transport = None                                                                  

Method Details

clearScreen(self)

Clear the screen, and return the cursor to 0, 0.

dataReceived(self, data)

Called whenever data is received.

Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.
Parameters:
data - a string of indeterminate length. Please keep in mind that you will probably need to buffer some data, as partial (or multiple) protocol messages may be received! I recommend that unit tests for protocols call through to this method with differing chunk sizes, down to one byte at a time.
Overrides:
twisted.internet.protocol.Protocol.dataReceived (inherited documentation)

eraseToLine(self)

Erase from the current position to the end of the line.

eraseToScreen(self)

Erase from the current position to the end of the screen.

gotoXY(self, x, y)

Go to a position on the screen.

keyReceived(self, key)

Called when the user hits a key.

refresh(self)

Redraw the screen.

setAttributes(self, *attrs)

Set the attributes for drawing on the screen.

windowSizeChanged(self)

Called when the size of the window changes. Might want to redraw the screen here, or something.

writeCh(self, ch)

Write a character to the screen. If we're at the end of the row, ignore the write.

writeStr(self, s)

Write a string to the screen. This does not wrap a the edge of the screen, and stops at \r and \n.

Class Variable Details

escapeTimeout

Type:
float
Value:
0.20000000000000001                                                   

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