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

Method set_environment_default

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

Source from the content-addressed store, hash-verified

109
110 @staticmethod
111 def set_environment_default(get):
112 try:
113 path = get.path.strip()
114 except:
115 return json_response(False, '参数错误')
116 if not path or path == "close":
117 path = ""
118 em = EnvironmentManager()
119 res = em.set_python2env(path)
120 if not path:
121 if not res:
122 return json_response(True, msg="关闭成功")
123 else:
124 return json_response(False, res)
125 else:
126 if not res:
127 return json_response(True, msg="设置成功")
128 else:
129 return json_response(False, res)
130
131 @staticmethod
132 def set_environment_ps(get):

Callers

nothing calls this directly

Calls 3

set_python2envMethod · 0.95
json_responseFunction · 0.90
EnvironmentManagerClass · 0.90

Tested by

no test coverage detected