#NEWLINE# def parameters( command ) : #NEWLINE# #INDENT# command = synonym ( command ) #NEWLINE# params = [ ] #NEWLINE# if ( command in [ 'CLIENT_CONNECT' , 'CLIENT_DISCONNECT' ] ) : #NEWLINE# #INDENT# params . append ( 'host' ) #NEWLINE# params . append ( 'port' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'PING' , 'ERR_NOMOTD' ] ) : #NEWLINE# #INDENT# params . append ( 'message' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'PRIVMSG' , 'NOTICE' ] ) : #NEWLINE# #INDENT# add_nickmask ( params ) #NEWLINE# params . append ( 'target' ) #NEWLINE# params . append ( 'message' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'JOIN' ] ) : #NEWLINE# #INDENT# add_nickmask ( params ) #NEWLINE# params . append ( 'channel' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'QUIT' ] ) : #NEWLINE# #INDENT# add_nickmask ( params ) #NEWLINE# params . append ( 'message' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'RPL_TOPIC' , 'RPL_NOTOPIC' , 'RPL_ENDOFNAMES' ] ) : #NEWLINE# #INDENT# params . append ( 'channel' ) #NEWLINE# params . append ( 'message' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'PART' ] ) : #NEWLINE# #INDENT# add_nickmask ( params ) #NEWLINE# params . append ( 'channel' ) #NEWLINE# params . append ( 'message' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'INVITE' ] ) : #NEWLINE# #INDENT# add_nickmask ( params ) #NEWLINE# params . append ( 'target' ) #NEWLINE# params . append ( 'channel' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'RPL_MOTDSTART' , 'RPL_MOTD' , 'RPL_ENDOFMOTD' , 'RPL_WELCOME' , 'RPL_YOURHOST' , 'RPL_CREATED' , 'RPL_LUSERCLIENT' , 'RPL_LUSERME' ] ) : #NEWLINE# #INDENT# params . append ( 'message' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'RPL_LUSEROP' , 'RPL_LUSERUNKNOWN' , 'RPL_LUSERCHANNELS' ] ) : #NEWLINE# #INDENT# params . append ( 'count' ) #NEWLINE# params . append ( 'message' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( command in [ 'RPL_MYINFO' , 'RPL_BOUNCE' ] ) : #NEWLINE# #INDENT# params . append ( 'info' ) #NEWLINE# params . append ( 'message' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( "Unknown command '{}'" . format ( command ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return params