Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pager.py
Go to the documentation of this file.
1from abc import ABC, abstractmethod
2from typing import Any
3
4
5class 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
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
28if __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())
None show(self, str content)
Definition pager.py:9
None show(self, str content)
Definition pager.py:23
Any _pager(self, str content)
Definition pager.py:20
for i