Execute a command in a console.
(
self,
request: Request,
command: str,
frame: DebugFrameSummary | _ConsoleFrame,
)
| 382 | environ["wsgi.errors"].write("".join(tb.render_traceback_text())) |
| 383 | |
| 384 | def execute_command( |
| 385 | self, |
| 386 | request: Request, |
| 387 | command: str, |
| 388 | frame: DebugFrameSummary | _ConsoleFrame, |
| 389 | ) -> Response: |
| 390 | """Execute a command in a console.""" |
| 391 | if not self.check_host_trust(request.environ): |
| 392 | return SecurityError() # type: ignore[return-value] |
| 393 | |
| 394 | contexts = self.frame_contexts.get(id(frame), []) |
| 395 | |
| 396 | with ExitStack() as exit_stack: |
| 397 | for cm in contexts: |
| 398 | exit_stack.enter_context(cm) |
| 399 | |
| 400 | return Response(frame.eval(command), mimetype="text/html") |
| 401 | |
| 402 | def display_console(self, request: Request) -> Response: |
| 403 | """Display a standalone shell.""" |
no test coverage detected