moo.shell.iac.IacParser

class moo.shell.iac.IacParser

Byte-feed state machine for IAC sequences.

Feed raw bytes via the feed method; get back a list of events and the residual non-IAC bytes (which should be decoded as UTF-8 by the caller). Partial frames across feed calls are buffered internally.

Each event is a tuple. ("cmd", cmd, opt) represents an IAC WILL/WONT/DO/DONT command. ("sb", opt, payload_bytes) is a subnegotiation. ("ga",) and ("eor",) are the GA and EOR end-of-prompt markers.

__init__()

Methods

__init__()

feed(data)

Feed raw bytes; return a tuple of (events, residual).