<s> from . import CommandManager <EOL> from . protocol import manager as protocol_manager <EOL> manager = CommandManager ( ) <EOL> manager . merge ( protocol_manager ) <EOL> @ manager . command <EOL> def println ( connection , * args ) : <EOL> print '<STR_LIT:U+0020>' . join ( map ( str , args ) ) <EOL> @ manager . command <EOL> def switch ( connection , chan ) : <EOL> connection . channel = chan <EOL> connection . println ( '<STR_LIT>' , chan ) <EOL> @ manager . command <EOL> def list ( connection ) : <EOL> connection . println ( '<STR_LIT>' , * connection . channels . keys ( ) ) <EOL> @ manager . override <EOL> def join ( connection , super , chan ) : <EOL> super ( connection , chan ) <EOL> switch ( connection , chan ) <EOL> @ manager . override <EOL> def part ( connection , super , chan , reason = None ) : <EOL> switch ( connection , None ) <EOL> super ( connection , chan , reason ) <EOL> @ manager . override <EOL> def privmsg ( connection , super , chan , msg = None ) : <EOL> if msg is None : <EOL> chan , msg = connection . channel , chan <EOL> super ( connection , chan , msg ) <EOL> @ manager . override <EOL> def notice ( connection , super , chan , msg = None ) : <EOL> if msg is None : <EOL> chan , msg = connection . channel , chan <EOL> super ( connection , chan , msg ) </s>
