示例#1
0
    def _merge(self):
        with proj.MirageEnvironment(proj.MirageEnvironmentLevel.inapp):
            mys.log("Integrate migrations...")

            with proj.InDir("migrations"):
                path_obj = Path(os.getcwd())
                migration_script_path = path_obj.glob("*.py")

                for path in migration_script_path:
                    if not "__init__.py" in str(path):
                        mys.log("Removing " + str(path) + "!")
                        os.remove(path)
                
            with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango):
                os.system("python manage.py makemigrations")
示例#2
0
    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():
                mys.log(os.getcwd())
                shutil.copytree(self._app, os.path.join(self._to, self._app))
                logger.update("Completed!")
            else:
                logger.update("Can not detect application %s!" % self._app)
                mys.log("Failed to transfer app %s!" % self._app,
                        withError=True,
                        errorDetail=mys.raise_error_message(
                            "The application diresctory does not exists!"))
                return
示例#3
0
 def main(self):
     with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango):
         try:
             os.system("python manage.py runserver")
         except KeyboardInterrupt:
             mys.log("Good bye!")
         except:
             mys.log("Failed to launch web browser!", withError=True)
示例#4
0
    def __init__(self, file_type = None):

        with proj.MirageEnvironment(proj.MirageEnvironmentLevel.inproject):
            if file_type == "secret":
                self._data = self._load_json("Miragefile.secret")
            elif file_type == "addon":
                self._data = self._load_json("Miragefile.addon")
            elif file_type == None:
                self._data = self._load_json("Miragefile")
            else:
                mys.log("Wrong configuration type {0}.".format(file_type), withError = True)
示例#5
0
 def _create_app(self, name):
     with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango):
         mys.command("python manage.py startapp " + name)
示例#6
0
 def excute_manage_cmd(self):
     with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango):
         os.system("python manage.py " + self._cmd)
示例#7
0
 def main(self):
     with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango):
         os.system("python manage.py createsuperuser")
 def main(self):
     with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango):
         mys.log("Launching Django Python Shell")
         os.system("python manage.py shell")
示例#9
0
 def main(self):
     with proj.MirageEnvironment(proj.MirageEnvironmentLevel.inproject):
         mys.log("Creating heroku configurations...")
         self._create_heroku_configuation()
示例#10
0
 def main(self):
     with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango):
         mys.log("Making migrations...")
         self._make_migration()
         self._apply_migration()