From 01fa71a70477907dd9c000ad72859b12d0b3a1fa Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sun, 28 Apr 2019 07:18:40 +0200 Subject: [PATCH] Prefer pwd to install dir for temp files Temp files are project specific and thus can stay in the current project directory. Also breaks things if the package is installed in a read-only location. Which could be expected because you don't generally expect the program directories to be modified (except by the package manager). --- manimlib/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manimlib/constants.py b/manimlib/constants.py index 375e6e76..9be21e2a 100644 --- a/manimlib/constants.py +++ b/manimlib/constants.py @@ -14,7 +14,7 @@ else: "Dropbox (3Blue1Brown)/3Blue1Brown Team Folder" ) if not os.path.isdir(MEDIA_DIR): - MEDIA_DIR = "media" + MEDIA_DIR = "./media" print( f"Media will be stored in {MEDIA_DIR + os.sep}. You can change " "this behavior by writing a different directory to media_dir.txt." @@ -26,7 +26,7 @@ SVG_IMAGE_DIR = os.path.join(MEDIA_DIR, "designs", "svg_images") SOUND_DIR = os.path.join(MEDIA_DIR, "designs", "sounds") ### THIS_DIR = os.path.dirname(os.path.realpath(__file__)) -FILE_DIR = os.path.join(os.getenv("FILE_DIR", default=THIS_DIR), "files") +FILE_DIR = os.path.join(os.getenv("FILE_DIR", default="."), "files") TEX_DIR = os.path.join(FILE_DIR, "Tex") # These two may be depricated now. MOBJECT_DIR = os.path.join(FILE_DIR, "mobjects")