Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def command(command, withOutput = False):
warning.warn("command.command will be deprecated on next release!", warning.PendingDeprecationWarning)
separated_cmds = command.split(" ")
if withOutput:
try:
check_output(separated_cmds, stderr=STDOUT)
except:
log("Failed to exec " + command + "!", withError = True)
return
else:
try:
check_output(separated_cmds, stderr=DEVNULL)
except:
log("Failed to exec " + command + "!", withError = True)
return
def get_project_name():
warning.warn("get_project_name will be deprecated on next release.", warning.PendingDeprecationWarning)
current_dir = os.getcwd()
directories = os.listdir(".")
app_name = "FAILED TO GET"
if in_project():
for directory in directories:
try:
os.chdir(directory)
if os.path.isfile("settings.py"):
app_name = str(os.getcwd()).split("/")[-1]
os.chdir(current_dir)
except:
pass
def project_name():
warning.warn("project_name will be deprecated on next release.", warning.PendingDeprecationWarning)
status = False
if os.path.isfile("manage.py"):
status = True
else:
status = False
if status:
contents = os.listdir(os.getcwd())
for test in contents:
if os.path.isdir(test):
current = os.getcwd()
os.chdir(test)
def load_secret_conf():
warning.warn("mirage.project is now pending deprecation.", warning.PendingDeprecationWarning)
with open("Miragefile.secret", "r") as djfile:
try:
return json.load(djfile)
except:
raise Exception