Created
April 11, 2013 02:41
-
-
Save aji/5360228 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class linebuf: | |
def __init__(self): | |
self.s = [''] | |
def data(self, data): | |
self.s[-1:] = (self.s[-1] + data).split('\r\n') | |
lines, self.s = self.s[:-1], self.s[-1:] | |
return lines |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment