| 159 | |
| 160 | |
| 161 | class AnsiColorTheme(ColorTheme): |
| 162 | def __getattr__(self, attr): |
| 163 | # type: (str) -> _ColorFormatterType |
| 164 | if attr.startswith("__"): |
| 165 | raise AttributeError(attr) |
| 166 | s = "style_%s" % attr |
| 167 | if s in self.__class__.__dict__: |
| 168 | before = getattr(self, s) |
| 169 | after = self.style_normal |
| 170 | elif not isinstance(self, BlackAndWhite) and attr in Color.colors: |
| 171 | before = Color.colors[attr][0] |
| 172 | after = Color.colors["normal"][0] |
| 173 | else: |
| 174 | before = after = "" |
| 175 | |
| 176 | return create_styler(before=before, after=after) |
| 177 | |
| 178 | |
| 179 | class BlackAndWhite(AnsiColorTheme, NoTheme): |
no outgoing calls
no test coverage detected
searching dependent graphs…