]> git.scottworley.com Git - paperdoorknob/blobdiff - paperdoorknob.py
Rename: fetch → parse
[paperdoorknob] / paperdoorknob.py
index f83c9f869651a0a35fd86fdf11fdb004e5e5ae4d..31ce02c494ea29aadc8794d75f11ee8397729a2c 100644 (file)
@@ -40,8 +40,8 @@ def command_line_parser() -> ArgumentParser:
     return parser
 
 
-def fetch(url: str, fetcher: Fetcher) -> BeautifulSoup:
-    return BeautifulSoup(fetcher.fetch(url), 'html.parser')
+def parse(content: bytes) -> BeautifulSoup:
+    return BeautifulSoup(content, 'html.parser')
 
 
 def clean(html: BeautifulSoup) -> BeautifulSoup:
@@ -81,7 +81,7 @@ def process(
         texout: IO[bytes],
         pandoc: str) -> None:
     texout.write(b'\\documentclass{article}\n\\begin{document}\n')
-    html = clean(fetch(url, fetcher))
+    html = clean(parse(fetcher.fetch(url)))
     for r in replies(html):
         texout.write(html_to_tex(pandoc, r))
     texout.write(b'\\end{document}\n')