diff options
author | 2022-01-10 13:57:28 +0530 | |
---|---|---|
committer | 2022-01-10 13:57:28 +0530 | |
commit | 36422df82d9aa010a71a7744a38105fa91aad20d (patch) | |
tree | bfc168627ebf8613c3d24c3b91b0af3d243a8181 /bot/exts/fun/latex/_renderer.py | |
parent | add latex command (diff) |
run isort and flake8
Diffstat (limited to 'bot/exts/fun/latex/_renderer.py')
-rw-r--r-- | bot/exts/fun/latex/_renderer.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bot/exts/fun/latex/_renderer.py b/bot/exts/fun/latex/_renderer.py index 3f6528ad..fb72b94c 100644 --- a/bot/exts/fun/latex/_renderer.py +++ b/bot/exts/fun/latex/_renderer.py @@ -1,5 +1,4 @@ import sys - from pathlib import Path from typing import BinaryIO @@ -19,7 +18,9 @@ plt.rcParams.update( def render(text: str, file_handle: BinaryIO) -> None: """ - Saves rendered image in `file_handle`. In case the input is invalid latex, it prints the error to `stderr`. + Saves rendered image in `file_handle`. + + In case the input is invalid latex, it prints the error to `stderr`. """ fig = plt.figure() fig.text(0, 1, text, horizontalalignment="left", verticalalignment="top") @@ -30,9 +31,10 @@ def render(text: str, file_handle: BinaryIO) -> None: sys.exit(err) -def main(): +def main() -> None: """ Renders a latex query and saves the output in a specified file. + Expects two command line arguments: the query and the path to the output file. """ query = sys.argv[1] |