How to use the mirage.system.warning.warn function in mirage

To help you get started, we’ve selected a few mirage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shotastage / mirage-django-lts / mirage / command.py View on Github external
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
github shotastage / mirage-django-lts / mirage / proj / old_api.py View on Github external
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
github shotastage / mirage-django-lts / mirage / proj / old_api.py View on Github external
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)
github shotastage / mirage-django-lts / mirage / project.py View on Github external
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