From 362c3265031b91eb78890a515da48b47ca20376d Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 14 Dec 2021 12:38:33 +0100 Subject: add Cgit filters --- utils.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 utils.py (limited to 'utils.py') diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..40a8f81 --- /dev/null +++ b/utils.py @@ -0,0 +1,20 @@ +import sys +import io +from typing import Optional + +from pygments.formatters import HtmlFormatter + + +def configure_io(): + sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', errors='replace') + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') + + +def write_style(formatter: HtmlFormatter, opt_style: Optional[str] = None): + sys.stdout.write('') -- cgit v1.2.3-18-g5258