Push a line to the interpreter. The line should not have a trailing newline; it may have internal newlines. The line is appended to a buffer and the interpreter's runsource() method is called with the concatenated contents of the buffer as source. If this i
(self, line)
| 480 | self.write("%s\n" % exitmsg) |
| 481 | |
| 482 | def push(self, line): |
| 483 | """Push a line to the interpreter. |
| 484 | |
| 485 | The line should not have a trailing newline; it may have |
| 486 | internal newlines. The line is appended to a buffer and the |
| 487 | interpreter's runsource() method is called with the |
| 488 | concatenated contents of the buffer as source. If this |
| 489 | indicates that the command was executed or invalid, the buffer |
| 490 | is reset; otherwise, the command is incomplete, and the buffer |
| 491 | is left as it was after the line was appended. The return |
| 492 | value is 1 if more input is required, 0 if the line was dealt |
| 493 | with in some way (this is the same as runsource()). |
| 494 | |
| 495 | """ |
| 496 | self.buffer.append(line) |
| 497 | source = "\n".join(self.buffer) |
| 498 | more = self.runsource(source, self.filename) |
| 499 | if not more: |
| 500 | self.resetbuffer() |
| 501 | return more |
| 502 | |
| 503 | def raw_input(self, prompt=""): |
| 504 | """Write a prompt and read a line. |
no test coverage detected