Changed manim downloads location from default to custom_default config

This commit is contained in:
Sahil Makhijani 2021-02-03 00:04:30 +05:30
parent 46309e26c7
commit 32632367b6
2 changed files with 5 additions and 4 deletions

View file

@ -23,6 +23,9 @@ def get_text_dir():
def get_mobject_data_dir():
return guarantee_existence(os.path.join(get_temp_dir(), "mobject_data"))
def get_downloads_dir():
return guarantee_existence(os.path.join(get_temp_dir(), "manim_downloads"))
def get_output_dir():
return guarantee_existence(get_directories()["output"])

View file

@ -3,7 +3,6 @@ import numpy as np
import validators
import urllib.request
import tempfile
def add_extension_if_not_present(file_name, extension):
@ -24,10 +23,9 @@ def find_file(file_name, directories=None, extensions=None):
# Check if this is a file online first, and if so, download
# it to a temporary directory
if validators.url(file_name):
from manimlib.utils.directories import get_downloads_dir
stem, name = os.path.split(file_name)
folder = guarantee_existence(
os.path.join(tempfile.gettempdir(), "manim_downloads")
)
folder = get_downloads_dir()
path = os.path.join(folder, name)
urllib.request.urlretrieve(file_name, path)
return path