def refreshFromReadline(self):
        newLines = []

        #for some reason, this import segfaults if we do it as part of our routine
        #setup in the test harness. Putting the import here ensures we only
        #import it when we are actively using it (e.g. there is a terminal connected
        #to stdin)
        import readline

        while len(self.lines) + len(newLines) < readline.get_current_history_length():
            newLines.append(readline.get_history_item(len(self.lines) + len(newLines) + 1) + "\n")

        self.lines += newLines
        for block in self.divideIntoBlocks(newLines):
            self.addBlock(block)

        return self
Consume as much content as possible from the line buffer.
dataset/ETHPy150Open ufora/ufora/packages/python/pyfora/StdinCache.py/StdinCache.refreshFromReadline