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

Method __prepare_python_start_conf

class/projectModel/pythonModel.py:1031–1060  ·  view source on GitHub ↗
(self, values, pyenv: PythonEnvironment, force=False)

Source from the content-addressed store, hash-verified

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):

Callers 1

__prepare_start_confMethod · 0.95

Calls 10

_build_env_fileMethod · 0.95
_get_vp_pythonMethod · 0.95
_create_cmd_fileMethod · 0.95
dirnameMethod · 0.80
activate_shellMethod · 0.80
Md5Method · 0.80
formatMethod · 0.45
existsMethod · 0.45
replaceMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected