Wrap message with margin for progress info.
(
self,
content: str,
*,
flush: bool = False,
margin: int = 8,
line_sep: str = "\n",
**markup: bool,
)
| 501 | self.currentfspath = None |
| 502 | |
| 503 | def wrap_write( |
| 504 | self, |
| 505 | content: str, |
| 506 | *, |
| 507 | flush: bool = False, |
| 508 | margin: int = 8, |
| 509 | line_sep: str = "\n", |
| 510 | **markup: bool, |
| 511 | ) -> None: |
| 512 | """Wrap message with margin for progress info.""" |
| 513 | width_of_current_line = self._tw.width_of_current_line |
| 514 | wrapped = line_sep.join( |
| 515 | textwrap.wrap( |
| 516 | " " * width_of_current_line + content, |
| 517 | width=self._screen_width - margin, |
| 518 | drop_whitespace=True, |
| 519 | replace_whitespace=False, |
| 520 | ), |
| 521 | ) |
| 522 | wrapped = wrapped[width_of_current_line:] |
| 523 | self._tw.write(wrapped, flush=flush, **markup) |
| 524 | |
| 525 | def write(self, content: str, *, flush: bool = False, **markup: bool) -> None: |
| 526 | self._tw.write(content, flush=flush, **markup) |
no test coverage detected