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 "CLICOLOR",19 "COLORTERM",20 "COLUMNS",21 "JPY_PARENT_PID",22 "JUPYTER_COLUMNS",23 "JUPYTER_LINES",24 "LINES",25 "NO_COLOR",26 "TERM_PROGRAM",27 "TERM",28 "TTY_COMPATIBLE",29 "TTY_INTERACTIVE",30 "VSCODE_VERBOSE_LOGGING",31 )32 env = {name: os.getenv(name) for name in env_names}33 console.print(Panel.fit((Pretty(env)), title="[b]Environment Variables"))34 35 console.print(f'platform="{platform.system()}"')36 37 38if __name__ == "__main__": # pragma: no cover39 report()40 