1 from message import Message
8 def feed_line(self, line):
10 msg_id, msg_fragment = line.rstrip("\n").split(' ', 1)
12 raise Exception("Invalid fragment!")
15 if msg_id in self._messages:
16 self._messages[msg_id].feed_fragment(msg_fragment)
18 self._messages[msg_id] = Message(msg_fragment)
20 if self._messages[msg_id].is_complete():
21 self._decoded.append( self._messages[msg_id].get_content() )
22 del self._messages[msg_id]
24 except Exception as e:
25 if msg_id in self._messages:
26 del self._messages[msg_id]
29 def fetch_decoded(self):
30 decoded = self._decoded