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

Method prep_status

class/projectModel/pythonModel.py:598–614  ·  view source on GitHub ↗
(self, project_conf: dict)

Source from the content-addressed store, hash-verified

596 return True, ""
597
598 def prep_status(self, project_conf: dict):
599 try:
600 prep_pid_file = "{}/{}.pid".format(self._prep_path, project_conf["pjname"])
601 pid = public.readFile(prep_pid_file)
602 if isinstance(pid, str):
603 ps = psutil.Process(int(pid))
604 if ps.is_running() and os.path.samefile(ps.exe(), "/www/server/panel/pyenv/bin/python3") and \
605 any("script/py_project_env.py" in tmp for tmp in ps.cmdline()):
606 return "running"
607 except:
608 pass
609 v_path = project_conf["vpath"]
610 v_pip: str = self._get_vp_pip(v_path)
611 v_python: str = self._get_vp_python(v_path)
612 if not os.path.exists(v_path) or not os.path.exists(v_python) or not os.path.exists(v_pip):
613 return "failure"
614 return "complete"
615
616 # 检查输入参数
617 def __check_args(self, get):

Callers 10

re_prep_envMethod · 0.95
RestartProjectMethod · 0.95
RemoveProjectMethod · 0.95
_get_project_stateMethod · 0.95
ChangeProjectConfMethod · 0.95
GetProjectInfoMethod · 0.95
BindExtranetMethod · 0.95
manage_packageMethod · 0.95

Calls 6

_get_vp_pipMethod · 0.95
_get_vp_pythonMethod · 0.95
readFileMethod · 0.80
formatMethod · 0.45
is_runningMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected