def write(self, s):
"""
Calls the StringIO.write() method then the callback_write with
given string parameter.
"""
# io.StringIO expects unicode
s_unicode = s.decode('utf-8')
super(StringIOCBWrite, self).write(s_unicode)
if self.callback_write is not None:
self.callback_write(s_unicode)
评论列表
文章目录