How to use the mirage.system.warning 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 / proj / old_api.py View on Github external
def load_secret_conf():
    warning.warn("load_secret_conf will be deprecated on next release.", warning.PendingDeprecationWarning)

    with open("Miragefile.secret", "r") as djfile:
        try:
            return json.load(djfile)
        except:
            raise Exception
github shotastage / mirage-django-lts / mirage / project.py View on Github external
def in_project():
    warning.warn("mirage.project is now pending deprecation.", warning.PendingDeprecationWarning)
    try:
        set_import_root()

        import manage

        return True
    except ImportError:
        return False
    except:
        return False
github shotastage / mirage-django-lts / mirage / project.py View on Github external
def set_import_root():
    warning.warn("mirage.project is now pending deprecation.", warning.PendingDeprecationWarning)
    sys.path.append("./")
github shotastage / mirage-django-lts / mirage / proj / old_api.py View on Github external
def set_import_root():
    warning.warn("set_import_root will be deprecated on next release.", warning.PendingDeprecationWarning)
    sys.path.append("./")
github shotastage / mirage-django-lts / mirage / proj / environ.py View on Github external
def get_app_list() -> list:
        """
        Return application lists.

        returns:
            - (Array) cwd is in app dir returns True
        """

        warning.warn("This method is now under construction.", warning.UnderConstructionWarning)

        apps = []
        list_dir = os.listdir(os.getcwd())
        current = os.getcwd()

        if not MirageEnvironment.in_project(): return

        for dir_file in list_dir:
            if os.path.isdir(dir_file):
                os.chdir(dir_file)
                if MirageEnvironment.in_app():
                    apps.append(dir_file)
                os.chdir(current)
            else:
                continue
github shotastage / mirage-django-lts / mirage / project.py View on Github external
def in_app():
    warning.warn("mirage.project is now pending deprecation.", warning.PendingDeprecationWarning)
    try:
        set_import_root()

        import apps
        
        if os.path.isfile("apps.py"):
            return True
        else:
            return False
    except ImportError:
        return False
    except:
        return False
github shotastage / mirage-django-lts / mirage / proj / old_api.py View on Github external
def in_project():
    warning.warn("in_project will be deprecated on next release.", warning.PendingDeprecationWarning)
    try:
        set_import_root()

        import manage

        return True
    except ImportError:
        return False
    except:
        return False
github shotastage / mirage-django-lts / mirage / command.py View on Github external
def log(string,
            withError = False, errorDetail = None,
            withInput = False, withConfirm = False, default = None):
    
    warning.warn("command.log will be deprecated on next release!", warning.PendingDeprecationWarning)


    if withError:

        print('\033[31mMirage: ' + str(string) + '\033[0m')

        if not errorDetail == None:
            separator_begin = "===== Error Detail =======================================================\n"
            separator_end   = "==========================================================================\n"
            print('\033[31m' + separator_begin + errorDetail + "\n" + separator_end + '\033[0m')


    elif withInput:
        string = str(input('\033[32m' + str(string) + ' >> \033[0m'))
        
        if string == "" and default != None: