MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / update_all_project

Method update_all_project

class/projectModel/pythonModel.py:3593–3606  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3591 return public.returnMsg(True, "卸载成功")
3592
3593 def update_all_project(self):
3594 all_project = public.M('sites').where('project_type=?', ('Python',)).select()
3595 if not isinstance(all_project, list):
3596 return
3597 for p in all_project:
3598 project_config = json.loads(p["project_config"])
3599 if project_config["stype"] == "python":
3600 project_config["project_cmd"] = "{vpath} -u {run_file} {parm} ".format(
3601 vpath=self._get_vp_python(project_config["vpath"]),
3602 run_file=project_config['rfile'],
3603 parm=project_config['parm']
3604 )
3605 project_config["stype"] = "command"
3606 public.M("sites").where("id=?", (p["id"],)).update({"project_config": json.dumps(project_config)})
3607
3608 @staticmethod
3609 def _read_requirement_file(requirement_path):

Callers 1

GetProjectListMethod · 0.95

Calls 8

_get_vp_pythonMethod · 0.95
selectMethod · 0.45
whereMethod · 0.45
MMethod · 0.45
loadsMethod · 0.45
formatMethod · 0.45
updateMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected