예제 #1
0
파일: irc.py 프로젝트: kirkeby/flexo
 def parse_line(self, line):
     prefix, command, parameters = parse_message(line)
     return Message(self, prefix, command, parameters)
예제 #2
0
def test_parse_without_trailing():
    assert parse_message(':localhost 001 Welcome.') \
           == ['localhost', '001', ['Welcome.']]
    assert parse_message(':localhost FURRFU abc:def') \
           == ['localhost', 'FURRFU', ['abc:def']]
예제 #3
0
def test_parse_with_trailing():
    assert parse_message(':localhost PRIVMSG #cafeen :!lart Bender') \
           == ['localhost', 'PRIVMSG', ['#cafeen', '!lart Bender']]
    assert parse_message(':localhost KICK #cafeen kirkeby : Uuuuuud!') \
           == ['localhost', 'KICK', ['#cafeen', 'kirkeby', ' Uuuuuud!']]
예제 #4
0
def test_parse_prefixless():
    assert parse_message('PING 42') \
           == [None, 'PING', ['42']]
    assert parse_message('ERROR :Closing connection') \
           == [None, 'ERROR', ['Closing connection']]