def consume(self, input_char):
'''
Takes a byte into the channel
'''
if ord(input_char) >= 256:
raise Exception("Input char out of range")
if platform.python_version_tuple()[0] == '2':
encoded_char = to_unicode(input_char, 'utf-8')
else:
encoded_char = input_char
self._buffer += encoded_char
self.message_updated(self._buffer)
self.sequence_updated(self._buffer)
评论列表
文章目录