reformatted again

This commit is contained in:
Jason committed 2022-06-18 19:38:21 -04:00
1 parent 56ad559339
commit 894bc306c3
2 files changed
+17 -11

No files matched your search

+15 -10
View File
@@ -4,28 +4,32 @@ import tempfile
from os import path
from sys import platform
ACCEPTABLE_TO_BE_LEFT_BLANK = ['RANDOM_THREAD', 'TIMES_TO_RUN']
ACCEPTABLE_TO_BE_LEFT_BLANK = ["RANDOM_THREAD", "TIMES_TO_RUN"]
def envUpdate():
if path.exists(".env.template"): # if .env.template exists and .env does not exist
if platform == "win32" or platform == "cygwin":
runPS('utils/scripts/FileGrabber.ps1')
runPS("utils/scripts/FileGrabber.ps1")
with open(".\\video_creation\\data\\envvars.txt", "rb") as f:
envTemplate = f.read()
elif platform == "darwin" or platform == "linux":
envTemplate = subprocess.check_output("awk -F '=' 'NF {print $1}' .env.template | grep --regexp=^[a-zA-Z]",
shell=True, )
envTemplate = subprocess.check_output(
"awk -F '=' 'NF {print $1}' .env.template | grep --regexp=^[a-zA-Z]",
shell=True,
)
else:
raise OSError("Unsupported platform")
elif path.exists(".env"):
if platform == "win32" or platform == "cygwin":
runPS('utils/scripts/FileGrabberenv.ps1')
runPS("utils/scripts/FileGrabberenv.ps1")
with open(".\\video_creation\\data\\envvars.txt", "rb") as f:
envTemplate = f.read()
elif platform == "darwin" or platform == "linux":
envTemplate = subprocess.check_output("awk -F '=' 'NF {print $1}' .env | grep --regexp=^[a-zA-Z]",
shell=True, )
envTemplate = subprocess.check_output(
"awk -F '=' 'NF {print $1}' .env | grep --regexp=^[a-zA-Z]",
shell=True,
)
else:
raise OSError("Unsupported platform")
else:
@@ -35,7 +39,6 @@ def envUpdate():
tempEnv.seek(0)
envVars = tempEnv.readlines()
missing = []
isMissingEnvs = False
for env in envVars:
@@ -51,9 +54,11 @@ def envUpdate():
missing.append(env)
if isMissingEnvs:
printstr = ''
printstr = ""
[printstr + str(var) for var in missing]
print(f"The following environment variables are missing: {printstr}. Please add them to the .env file.")
print(
f"The following environment variables are missing: {printstr}. Please add them to the .env file."
)
exit(-1)