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")
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
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)
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)
def _create_app(self, name): with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango): mys.command("python manage.py startapp " + name)
def excute_manage_cmd(self): with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango): os.system("python manage.py " + self._cmd)
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")
def main(self): with proj.MirageEnvironment(proj.MirageEnvironmentLevel.inproject): mys.log("Creating heroku configurations...") self._create_heroku_configuation()
def main(self): with proj.MirageEnvironment(proj.MirageEnvironmentLevel.indjango): mys.log("Making migrations...") self._make_migration() self._apply_migration()