diff --git a/manimlib/scene/scene_file_writer.py b/manimlib/scene/scene_file_writer.py index a8546fb7..a29b347f 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 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 52e32bd3..e52e0316 100644 --- a/manimlib/utils/file_ops.py +++ b/manimlib/utils/file_ops.py @@ -55,35 +55,3 @@ def find_file( if os.path.exists(path): return path raise IOError(f"{file_name} not Found") - - -def get_sorted_integer_files( - directory: str, - min_index: float = 0, - max_index: float = np.inf, - remove_non_integer_files: bool = False, - remove_indices_greater_than: float | None = None, - extension: str | None = None, -) -> list[str]: - indexed_files = [] - for file in os.listdir(directory): - if '.' in file: - index_str = file[:file.index('.')] - else: - index_str = file - - full_path = os.path.join(directory, file) - if index_str.isdigit(): - index = int(index_str) - if remove_indices_greater_than is not None: - if index > remove_indices_greater_than: - os.remove(full_path) - continue - if extension is not None and not file.endswith(extension): - continue - if index >= min_index and index < max_index: - indexed_files.append((index, file)) - elif remove_non_integer_files: - os.remove(full_path) - indexed_files.sort(key=lambda p: p[0]) - return list(map(lambda p: os.path.join(directory, p[1]), indexed_files))