From debd63138550efc396f6475ef770745f01145eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Fri, 1 Nov 2024 09:18:01 +0100 Subject: [PATCH] chore(lib): simplify logic --- manim_slides/convert.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/manim_slides/convert.py b/manim_slides/convert.py index 4011aced..b693bc3c 100644 --- a/manim_slides/convert.py +++ b/manim_slides/convert.py @@ -395,19 +395,16 @@ def convert_to(self, dest: Path) -> None: # noqa: C901 Convert this configuration into a RevealJS HTML presentation, saved to DEST. """ - if self.data_uri and not self.offline: - assets_dir = None # Actually we won't care. - else: - dirname = dest.parent - basename = dest.stem - ext = dest.suffix + dirname = dest.parent + basename = dest.stem + ext = dest.suffix - assets_dir = Path( - self.assets_dir.format(dirname=dirname, basename=basename, ext=ext) - ) - full_assets_dir = dirname / assets_dir + assets_dir = Path( + self.assets_dir.format(dirname=dirname, basename=basename, ext=ext) + ) + full_assets_dir = dirname / assets_dir - if assets_dir is not None: + if not self.data_uri or self.offline: logger.debug(f"Assets will be saved to: {full_assets_dir}") full_assets_dir.mkdir(parents=True, exist_ok=True)