(get)
| 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): |
nothing calls this directly
no test coverage detected