Get the output margin for prompt, footer, timing, and status.
(self, status: str | None = None)
| 88 | click.secho(s, **kwargs) |
| 89 | |
| 90 | def get_output_margin(self, status: str | None = None) -> int: |
| 91 | """Get the output margin for prompt, footer, timing, and status.""" |
| 92 | if not self.prompt_lines: |
| 93 | if self.prompt_session and self.prompt_session.app: |
| 94 | render_counter = self.prompt_session.app.render_counter |
| 95 | else: |
| 96 | render_counter = 0 |
| 97 | prompt_string = repl_mode.render_prompt_string(self, self.prompt_format, render_counter) |
| 98 | self.prompt_lines = to_plain_text(prompt_string).count('\n') + 1 |
| 99 | margin = self.get_reserved_space() + self.prompt_lines |
| 100 | if special.is_timing_enabled(): |
| 101 | margin += 1 |
| 102 | if status: |
| 103 | margin += 1 + status.count("\n") |
| 104 | |
| 105 | return margin |
| 106 | |
| 107 | def output( |
| 108 | self, |
no test coverage detected