How to use the mirage.system 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 / confscript / reader.py View on Github external
def _load_script(self) -> object:
        with MirageEnvironment(WorkingLevel.inproject):
            sys.path.append(os.getcwd())

            try:
                fp, name, desc = imp.find_module("mirage.config")
                config_script = imp.load_module("config_script", fp, name, desc)

                if config_script.MirageConfig.assertBool():
                    mys.log("Config script loaded!")
                else:
                    mys.log("Failed to import mirage.config.py !", withError = True)
                    raise ImportError

            except ImportError:
                mys.log("Failed to import mirage.config.py !", withError = True)
github shotastage / mirage-django-lts / mirage / transfer / transfer.py View on Github external
def _check(self, logger):
        
        with proj.InDir(self._to):

            if Path(self._app).is_dir():
                if not mys.log("%s ia already exists.\nAre you sure to replace new one?" % self._app, withConfirm = True):
                    raise FileExistsError
                else:
                    os.system("rm -rf " + self._app)
github shotastage / mirage-django-lts / mini / flow.py View on Github external
def flow(self):

        for flow in self._flows:
            if "function" in str(type(flow)):
                try:
                    flow()
                except:
                    mys.log("Something error has occured!", withError = True, errorDetail = mys.raise_error_message(flow))
                    raise Exception
github shotastage / mirage-django-lts / mirage / projectstartup / minimum_app_create.py View on Github external
def _create_new_django_app(self):
        mys.command("django-admin startproject " + self._project_name)
github shotastage / mirage-django-lts / mirage / checker / update_check.py View on Github external
sys.path.append(td)
                request.urlretrieve(self._url, "mg_version_check.py")

                try:
                    import mg_version_check
                except ImportError:
                    mys.log("Failed to get version information!", withError=True,
                            errorDetail=mys.raise_error_message(self.main, traceback.format_exc()))
                    return

                if ver == mg_version_check.__version__:
                    if ver == "0.1.7":
                        mys.log("New mirage framework tools available!")
                        mys.log("See, https://github.com/shotastage/mirageframework for detail.")
                else:
                    mys.log("Update available!", withError=True)
                    print("This version: {0}".format(ver))
                    print("Available version: {0}".format(mg_version_check.__version__))
github shotastage / mirage-django-lts / mirage / transfer / transfer.py View on Github external
def main(self):
        # Beta Warning
        mys.log("This feature is now under Beta version.", withError=True)

        # Logger instance

        logger = mys.progress.Progress()
        
        with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango):

            # In advance checking.
            try:
                self._check(logger)
            except:
                return

            logger.write("Searching application %s..." % self._app, withLazy = True)

            if Path(self._app).is_dir():
github shotastage / mirage-django-lts / mini / db / db.py View on Github external
def __init__(self, subcommand):
        mys.log("Django DataBase is now unser development!", withError = True)
        self._subcommand = subcommand
github shotastage / mirage-django-lts / mini / console / django_console.py View on Github external
def main(self):
        if project.in_project():
            mys.log("Launching Django Python Shell")
            os.system("python manage.py shell")
        else:
            mys.log("Current dir " + os.getcwd() + " is out of Django project!", withError = True)