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

Class InsultsClient

BaseProtocol --+    
               |    
        Protocol --+
                   |
                  InsultsClient


Method Summary
  __init__(self)
  clearScreen(self)
Clear the screen, and return the cursor to 0, 0.
  connectionFailed(self)
(Deprecated) (inherited from Protocol)
  connectionLost(self, reason)
Called when the connection is shut down. (inherited from Protocol)
  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.

Class Variable Summary
float escapeTimeout

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 1.1 on Fri Jun 27 03:45:24 2003 http://epydoc.sf.net