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

Method create_python_env

mod/project/python/environmentMod.py:19–36  ·  view source on GitHub ↗
(get)

Source from the content-addressed store, hash-verified

17
18 @staticmethod
19 def create_python_env(get):
20 try:
21 venv_name = get.venv_name.strip()
22 src_python_bin = get.python_bin.strip()
23 if "ps" in get:
24 ps = get.ps.strip()
25 else:
26 ps = ""
27 except:
28 return json_response(False, '参数错误')
29
30 ws_send = None
31 if "_ws" in get:
32 ws_send = lambda x: get._ws.send(json.dumps({"callback": "create_python_env", "result": {"log": x}}))
33 res = EnvironmentManager().create_python_env(venv_name, src_python_bin, ps, ws_send)
34 if isinstance(res, str):
35 return json_response(False, res)
36 return json_response(True, msg="创建成功")
37
38 @staticmethod
39 def list_environment(get):

Callers

nothing calls this directly

Calls 4

json_responseFunction · 0.90
EnvironmentManagerClass · 0.90
sendMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected