mirror of
https://github.com/Textualize/rich.git
synced 2026-02-06 10:58:48 +00:00
Expose diagnose.report as a function add a little more info to hint at environment
This commit is contained in:
parent
94273ee703
commit
731f984822
@ -2,7 +2,8 @@
|
||||
omit = rich/jupyter.py
|
||||
rich/_windows.py
|
||||
rich/_timer.py
|
||||
|
||||
rich/diagnose.py
|
||||
|
||||
[report]
|
||||
exclude_lines =
|
||||
pragma: no cover
|
||||
|
||||
@ -1,6 +1,35 @@
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
from rich.console import Console
|
||||
from rich import inspect
|
||||
import os
|
||||
import platform
|
||||
|
||||
from rich import inspect
|
||||
from rich.console import Console, get_windows_console_features
|
||||
from rich.panel import Panel
|
||||
from rich.text import Text
|
||||
|
||||
|
||||
def report(): # pragma: no cover
|
||||
"""Print a report to the terminal with debugging information"""
|
||||
console = Console()
|
||||
inspect(console)
|
||||
features = get_windows_console_features()
|
||||
inspect(features)
|
||||
|
||||
if console.is_jupyter:
|
||||
jpy_parent_pid = os.getenv("JPY_PARENT_PID")
|
||||
vs_code_verbose = os.getenv("VSCODE_VERBOSE_LOGGING")
|
||||
console.print(
|
||||
Panel(
|
||||
title="Jupyter Environment Hints",
|
||||
renderable=Text(
|
||||
f"JPY_PARENT_PID = {jpy_parent_pid}\n"
|
||||
f"VSCODE_VERBOSE_LOGGING = {vs_code_verbose}"
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
console.print(f'platform="{platform.system()}"')
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
console = Console()
|
||||
inspect(console)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user