Apply simple color and style (underlined or bold).
(
self,
text: str,
color: Literal["red", "green", "blue", "yellow", "none"],
bold: bool = False,
underline: bool = False,
dim: bool = False,
)
| 719 | return True |
| 720 | |
| 721 | def style( |
| 722 | self, |
| 723 | text: str, |
| 724 | color: Literal["red", "green", "blue", "yellow", "none"], |
| 725 | bold: bool = False, |
| 726 | underline: bool = False, |
| 727 | dim: bool = False, |
| 728 | ) -> str: |
| 729 | """Apply simple color and style (underlined or bold).""" |
| 730 | if self.dummy_term: |
| 731 | return text |
| 732 | if bold: |
| 733 | start = self.BOLD |
| 734 | else: |
| 735 | start = "" |
| 736 | if underline: |
| 737 | start += self.UNDER |
| 738 | if dim: |
| 739 | start += self.DIM |
| 740 | return start + self.colors[color] + text + self.NORMAL |
| 741 | |
| 742 | def is_marker_line(self, line: str) -> bool: |
| 743 | s_line = line.lstrip() |
no outgoing calls