MCPcopy Index your code
hub / github.com/secdev/scapy / AnsiColorTheme

Class AnsiColorTheme

scapy/themes.py:161–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159
160
161class 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
179class BlackAndWhite(AnsiColorTheme, NoTheme):

Callers 2

_show_or_dumpMethod · 0.90
_show_or_dumpMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…