From c9dd2b3cfbbdc0275a54b1b974406d6f35ebd45b Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Wed, 11 Dec 2024 17:18:29 -0600 Subject: [PATCH] Remove add_extension_if_not_present --- manimlib/scene/scene_file_writer.py | 1 - manimlib/utils/file_ops.py | 8 -------- 2 files changed, 9 deletions(-) diff --git a/manimlib/scene/scene_file_writer.py b/manimlib/scene/scene_file_writer.py index 4aa6ffd3..a8546fb7 100644 --- a/manimlib/scene/scene_file_writer.py +++ b/manimlib/scene/scene_file_writer.py @@ -13,7 +13,6 @@ from pathlib import Path from manimlib.logger import log from manimlib.mobject.mobject import Mobject -from manimlib.utils.file_ops import add_extension_if_not_present from manimlib.utils.file_ops import get_sorted_integer_files from manimlib.utils.file_ops import guarantee_existence from manimlib.utils.sounds import get_full_sound_file_path diff --git a/manimlib/utils/file_ops.py b/manimlib/utils/file_ops.py index 20e2152f..52e32bd3 100644 --- a/manimlib/utils/file_ops.py +++ b/manimlib/utils/file_ops.py @@ -17,14 +17,6 @@ if TYPE_CHECKING: from typing import Iterable -def add_extension_if_not_present(file_name: str, extension: str) -> str: - # This could conceivably be smarter about handling existing differing extensions - if(file_name[-len(extension):] != extension): - return file_name + extension - else: - return file_name - - def guarantee_existence(path: str | Path) -> Path: path = Path(path) path.mkdir(parents=True, exist_ok=True)