codekingpro/portable-devtools
114k
1import os2import platform3 4from rich import inspect5from rich.console import Console, get_windows_console_features6from rich.panel import Panel7from rich.pretty import Pretty8 9 10def report() -> None: # pragma: no cover11 """Print a report to the terminal with debugging information"""12 console = Console()13 inspect(console)14 features = get_windows_console_features()15 inspect(features)16 17 env_names = (18 "TERM",19 "COLORTERM",20 "CLICOLOR",21 "NO_COLOR",22 "TERM_PROGRAM",23 "COLUMNS",24 "LINES",25 "JUPYTER_COLUMNS",26 "JUPYTER_LINES",27 "JPY_PARENT_PID",28 "VSCODE_VERBOSE_LOGGING",29 )30 env = {name: os.getenv(name) for name in env_names}31 console.print(Panel.fit((Pretty(env)), title="[b]Environment Variables"))32 33 console.print(f'platform="{platform.system()}"')34 35 36if __name__ == "__main__": # pragma: no cover37 report()38 