MCPcopy Index your code
hub / github.com/RustPython/RustPython / prepare

Method prepare

Lib/_pyrepl/reader.py:631–650  ·  view source on GitHub ↗

Get ready to run. Call restore when finished. You must not write to the console in between the calls to prepare and restore.

(self)

Source from the content-addressed store, hash-verified

629 self.arg = None
630
631 def prepare(self) -> None:
632 """Get ready to run. Call restore when finished. You must not
633 write to the console in between the calls to prepare and
634 restore."""
635 try:
636 self.console.prepare()
637 self.arg = None
638 self.finished = False
639 del self.buffer[:]
640 self.pos = 0
641 self.dirty = True
642 self.last_command = None
643 self.calc_screen()
644 except BaseException:
645 self.restore()
646 raise
647
648 while self.scheduled_commands:
649 cmd = self.scheduled_commands.pop()
650 self.do_cmd((cmd, []))
651
652 def last_command_is(self, cls: type) -> bool:
653 if not self.last_command:

Callers 5

suspendMethod · 0.95
readlineMethod · 0.95
doMethod · 0.45
doMethod · 0.45
showMethod · 0.45

Calls 4

calc_screenMethod · 0.95
restoreMethod · 0.95
do_cmdMethod · 0.95
popMethod · 0.45

Tested by

no test coverage detected