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).
This commit is contained in:
Daniel Schaefer
2019-04-28 07:18:40 +02:00
parent 55d76d2ee2
commit 01fa71a704

View File

@ -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")