(
self,
text: str = "",
style: Union[str, Style] = "",
*,
justify: Optional["JustifyMethod"] = None,
overflow: Optional["OverflowMethod"] = None,
no_wrap: Optional[bool] = None,
end: str = "\n",
tab_size: Optional[int] = None,
spans: Optional[List[Span]] = None,
)
| 142 | ] |
| 143 | |
| 144 | def __init__( |
| 145 | self, |
| 146 | text: str = "", |
| 147 | style: Union[str, Style] = "", |
| 148 | *, |
| 149 | justify: Optional["JustifyMethod"] = None, |
| 150 | overflow: Optional["OverflowMethod"] = None, |
| 151 | no_wrap: Optional[bool] = None, |
| 152 | end: str = "\n", |
| 153 | tab_size: Optional[int] = None, |
| 154 | spans: Optional[List[Span]] = None, |
| 155 | ) -> None: |
| 156 | sanitized_text = strip_control_codes(text) |
| 157 | self._text = [sanitized_text] |
| 158 | self.style = style |
| 159 | self.justify: Optional["JustifyMethod"] = justify |
| 160 | self.overflow: Optional["OverflowMethod"] = overflow |
| 161 | self.no_wrap = no_wrap |
| 162 | self.end = end |
| 163 | self.tab_size = tab_size |
| 164 | self._spans: List[Span] = spans or [] |
| 165 | self._length: int = len(sanitized_text) |
| 166 | |
| 167 | def __len__(self) -> int: |
| 168 | return self._length |
nothing calls this directly
no test coverage detected