(self, values, pyenv: PythonEnvironment, force=False)
| 1029 | values["start_sh"] = values["project_cmd"] |
| 1030 | |
| 1031 | def __prepare_python_start_conf(self, values, pyenv: PythonEnvironment, force=False): |
| 1032 | if not values["rfile"]: |
| 1033 | return |
| 1034 | cmd_file = "{}/{}_python.sh".format(self._script_path, values["pjname"]) |
| 1035 | if not force and os.path.exists(cmd_file): |
| 1036 | return |
| 1037 | pid_file = "{}/{}.pid".format(self._pid_path, values["pjname"]) |
| 1038 | env_file = "{}/{}.env".format(self._env_path, values["pjname"]) |
| 1039 | self._build_env_file(env_file, values) |
| 1040 | |
| 1041 | log_file = (values['logpath'] + "/error.log").replace("//", "/") |
| 1042 | v_python = self._get_vp_python(values['vpath']) |
| 1043 | command = "{vpath} -u {run_file} {parm} ".format( |
| 1044 | vpath=v_python, |
| 1045 | run_file=values['rfile'], |
| 1046 | parm=values.get("parm", "") |
| 1047 | ) |
| 1048 | self._create_cmd_file( |
| 1049 | cmd_file=cmd_file, |
| 1050 | v_ptah_bin=os.path.dirname(v_python), |
| 1051 | project_path=values["path"], |
| 1052 | command=command, |
| 1053 | log_file=log_file, |
| 1054 | pid_file=pid_file, |
| 1055 | env_file=env_file, |
| 1056 | activate_sh= pyenv.activate_shell(), |
| 1057 | evn_name=public.Md5(values["pjname"]), |
| 1058 | ) |
| 1059 | |
| 1060 | values["start_sh"] = command |
| 1061 | |
| 1062 | @staticmethod |
| 1063 | def _build_env_file(env_file: str, values: dict): |
no test coverage detected