Coverage for /run/media/veganeco/water/status600.com/pypi/reptilian_climates/modules_series_2/ships/fields/gardens_pip/rich/pager.py: 88%

1 from abc import ABC, abstractmethod

2 from typing import Any

3

4

5 class Pager(ABC):

6 """Base class for a pager."""

7

8 @abstractmethod

9 def show(self, content: str) -> None:

10 """Show content in pager.

11

12 Args:

13 content (str): Content to be displayed.

14 """

15

16

17 class SystemPager(Pager):

18 """Uses the pager installed on the system."""

19

20 def _pager(self, content: str) -> Any: # pragma: no cover

21 return __import__("pydoc").pager(content)

22

23 def show(self, content: str) -> None:

24 """Use the same pager used by pydoc."""

25 self._pager(content)

26

27

28 if __name__ == "__main__": # pragma: no cover

29 from .__main__ import make_test_card

30 from .console import Console

31

32 console = Console()

33 with console.pager(styles=True):

34 console.print(make_test_card())