Buckets:
AnonymousSpottedToad/human_verified_bucket / codebase /python /freqtrade_freqtrade /freqtrade /loggers /rich_console.py
| import sys | |
| from shutil import get_terminal_size | |
| from rich.console import Console | |
| def console_width() -> int | None: | |
| """ | |
| Get the width of the console | |
| """ | |
| if any(module in ["pytest", "ipykernel"] for module in sys.modules): | |
| return 200 | |
| width, _ = get_terminal_size((1, 24)) | |
| # Fall back to 200 if terminal size is not available. | |
| # This is determined by assuming an insane width of 1char, which is unlikely. | |
| w = None if width > 1 else 200 | |
| return w | |
| def get_rich_console(**kwargs) -> Console: | |
| """ | |
| Get a rich console with default settings | |
| """ | |
| kwargs["width"] = kwargs.get("width", console_width()) | |
| return Console(**kwargs) | |
Xet Storage Details
- Size:
- 685 Bytes
- Xet hash:
- 7aa90bdf99d0f1811e6f376e5c53ab6500c5d18e68d9b207347d9756957b50ce
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.