MCPcopy Index your code
hub / github.com/dbcli/mycli / get_output_margin

Method get_output_margin

mycli/output.py:90–105  ·  view source on GitHub ↗

Get the output margin for prompt, footer, timing, and status.

(self, status: str | None = None)

Source from the content-addressed store, hash-verified

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,

Callers 1

outputMethod · 0.95

Calls 1

get_reserved_spaceMethod · 0.95

Tested by

no test coverage detected