3b1b-manim/manimlib/utils/directories.py

51 lines
1.1 KiB
Python
Raw Normal View History

from __future__ import annotations
import os
2021-01-15 10:16:37 -10:00
from manimlib.utils.customization import get_customization
2022-04-12 19:19:59 +08:00
from manimlib.utils.file_ops import guarantee_existence
def get_directories() -> dict[str, str]:
2021-01-15 10:16:37 -10:00
return get_customization()["directories"]
def get_temp_dir() -> str:
return get_directories()["temporary_storage"]
def get_tex_dir() -> str:
return guarantee_existence(os.path.join(get_temp_dir(), "Tex"))
def get_text_dir() -> str:
2021-01-15 20:18:13 +08:00
return guarantee_existence(os.path.join(get_temp_dir(), "Text"))
def get_mobject_data_dir() -> str:
return guarantee_existence(os.path.join(get_temp_dir(), "mobject_data"))
2021-03-18 17:33:20 -07:00
def get_downloads_dir() -> str:
return guarantee_existence(os.path.join(get_temp_dir(), "manim_downloads"))
def get_output_dir() -> str:
return guarantee_existence(get_directories()["output"])
def get_raster_image_dir() -> str:
return get_directories()["raster_images"]
def get_vector_image_dir() -> str:
return get_directories()["vector_images"]
def get_sound_dir() -> str:
2021-01-23 11:02:02 -08:00
return get_directories()["sounds"]
def get_shader_dir() -> str:
return get_directories()["shaders"]