MCPcopy
hub / github.com/Datalux/Osintgram / has_colours

Function has_colours

src/printcolors.py:6–14  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

4
5
6def has_colours(stream):
7 if not (hasattr(stream, "isatty") and stream.isatty):
8 return False
9 try:
10 import curses
11 curses.setupterm()
12 return curses.tigetnum("colors") > 2
13 except:
14 return False
15
16
17has_colours = has_colours(sys.stdout)

Callers 1

printcolors.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected