From e6f6cf4aed1c460ed119927f318ea3e2241972bb Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 22 Feb 2023 18:03:03 -0800 Subject: [PATCH] Remove unnecessary function dump_file. --- voussoir.net/writing/vmarkdown.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/voussoir.net/writing/vmarkdown.py b/voussoir.net/writing/vmarkdown.py index cb145e1..bce3f8d 100644 --- a/voussoir.net/writing/vmarkdown.py +++ b/voussoir.net/writing/vmarkdown.py @@ -284,10 +284,6 @@ def cat_files(paths): content = [cat_file(path) for path in paths] return '\n\n'.join(content) -def dump_file(path): - with open(path, 'rb') as f: - return f.read() - # SOUP HELPERS ################################################################################ SECTION_SYMBOL = 'ยง' @@ -432,7 +428,7 @@ def embed_images(soup, cache=None): response.raise_for_status() data = response.content else: - data = dump_file(src) + data = pathclass.Path(src).read('rb') data = base64.b64encode(data).decode('ascii') mime = mimetypes.guess_type(src)[0] mime = mime if mime is not None else ''