def collect_incoming_data(self, data): buffer = self.escape_buffer + data i = async_chat.find_prefix_at_end(buffer, self.escape_from) if i > 0: self.collector.collect_incoming_data(self.escape(buffer[:-i])) self.escape_buffer = buffer[-i:] else: self.collector.collect_incoming_data(self.escape(buffer)) self.escape_buffer = ""
def collect_incoming_data (self, data): buffer = self.escape_buffer + data i = async_chat.find_prefix_at_end (buffer, self.escape_from) if i > 0: self.collector.collect_incoming_data ( self.escape (buffer[:-i]) ) self.escape_buffer = buffer[-i:] else: self.collector.collect_incoming_data ( self.escape (buffer) ) self.escape_buffer = ''
def more(self): buffer = self.escape_buffer + self.producer.more() if buffer: i = async_chat.find_prefix_at_end(buffer, self.escape_from) if i > 0: # we found a prefix self.escape_buffer = buffer[-i:] return self.escape(buffer[:-i]) # no prefix, return it all self.escape_buffer = "" return self.escape(buffer) return buffer
def more (self): buffer = self.escape_buffer + self.producer.more () if buffer: i = async_chat.find_prefix_at_end ( buffer, self.escape_from ) if i > 0: # we found a prefix self.escape_buffer = buffer[-i:] return self.escape (buffer[:-i]) # no prefix, return it all self.escape_buffer = '' return self.escape (buffer) return buffer