mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-11-10 17:13:35 +08:00
4a0932b5d3
* Update ffsubsync to 0.4.11 * Update srt to 3.4.1
32 lines
760 B
Python
32 lines
760 B
Python
from abc import ABC, abstractmethod
|
|
|
|
|
|
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."""
|
|
|
|
_pager = lambda self, content: __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())
|