MCPcopy
hub / github.com/python/mypy / style

Method style

mypy/util.py:721–740  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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()

Callers 9

console_entryFunction · 0.95
colorizeMethod · 0.95
underline_linkMethod · 0.95
format_successMethod · 0.95
format_errorMethod · 0.95
generate_annotated_htmlFunction · 0.95
_styleFunction · 0.80
install_typesFunction · 0.80

Calls

no outgoing calls

Tested by 1

_styleFunction · 0.64