'Buffered readline from node, potentially blocking.
returns: line (minus newline) or None'

def readline(self):

    self.readbuf += self.read(1024)
    if ('\n' not in self.readbuf):
        return None
    pos = self.readbuf.find('\n')
    line = self.readbuf[0:pos]
    self.readbuf = self.readbuf[(pos + 1):]
    return line
