Server IP : 66.29.132.122 / Your IP : 3.128.198.191 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/rich/ |
Upload File : |
from abc import ABC, abstractmethod from typing import Any class Pager(ABC): """Base class for a pager.""" @abstractmethod def show(self, content: str) -> None: """Show content in pager. Args: content (str): Content to be displayed. """ class SystemPager(Pager): """Uses the pager installed on the system.""" def _pager(self, content: str) -> Any: # pragma: no cover return __import__("pydoc").pager(content) def show(self, content: str) -> None: """Use the same pager used by pydoc.""" self._pager(content) if __name__ == "__main__": # pragma: no cover from .__main__ import make_test_card from .console import Console console = Console() with console.pager(styles=True): console.print(make_test_card())