mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Changed manim downloads location from default to custom_default config
This commit is contained in:
parent
46309e26c7
commit
32632367b6
2 changed files with 5 additions and 4 deletions
|
@ -23,6 +23,9 @@ def get_text_dir():
|
||||||
def get_mobject_data_dir():
|
def get_mobject_data_dir():
|
||||||
return guarantee_existence(os.path.join(get_temp_dir(), "mobject_data"))
|
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():
|
def get_output_dir():
|
||||||
return guarantee_existence(get_directories()["output"])
|
return guarantee_existence(get_directories()["output"])
|
||||||
|
|
|
@ -3,7 +3,6 @@ import numpy as np
|
||||||
|
|
||||||
import validators
|
import validators
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import tempfile
|
|
||||||
|
|
||||||
|
|
||||||
def add_extension_if_not_present(file_name, extension):
|
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
|
# Check if this is a file online first, and if so, download
|
||||||
# it to a temporary directory
|
# it to a temporary directory
|
||||||
if validators.url(file_name):
|
if validators.url(file_name):
|
||||||
|
from manimlib.utils.directories import get_downloads_dir
|
||||||
stem, name = os.path.split(file_name)
|
stem, name = os.path.split(file_name)
|
||||||
folder = guarantee_existence(
|
folder = get_downloads_dir()
|
||||||
os.path.join(tempfile.gettempdir(), "manim_downloads")
|
|
||||||
)
|
|
||||||
path = os.path.join(folder, name)
|
path = os.path.join(folder, name)
|
||||||
urllib.request.urlretrieve(file_name, path)
|
urllib.request.urlretrieve(file_name, path)
|
||||||
return path
|
return path
|
||||||
|
|
Loading…
Add table
Reference in a new issue