1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

add pager functionality to parser documentation

This commit is contained in:
Kelly Brazil
2022-07-15 11:18:02 -07:00
parent 6573b355cc
commit a7ee414c67
2 changed files with 14 additions and 3 deletions

View File

@ -29,6 +29,15 @@ def _safe_print(string: str, sep=' ', end='\n', file=sys.stdout, flush=False) ->
print(_asciify(string), sep=sep, end=end, file=file, flush=flush)
def _safe_pager(string: str) -> None:
"""Pager output for both UTF-8 and ASCII encoding systems"""
from pydoc import pager
try:
pager(string)
except UnicodeEncodeError:
pager(_asciify(string))
def warning_message(message_lines: List[str]) -> None:
"""
Prints warning message to `STDERR` for non-fatal issues. The first line