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

Method init_site_server_pkg

mod/project/python/pyenv_tool.py:436–448  ·  view source on GitHub ↗
(self, call_log:Optional[Callable[[str], None]] = None)

Source from the content-addressed store, hash-verified

434 return False
435
436 def init_site_server_pkg(self, call_log:Optional[Callable[[str], None]] = None) -> bool:
437 pkg_list = ("uwsgi", "gunicorn", "uvicorn", "hypercorn", "daphne")
438 status = True
439 for pkg in pkg_list:
440 if self.pkg_file_exits(pkg):
441 call_log("{} 已安装".format(pkg))
442 continue
443 call_log("正在安装 {} ....".format(pkg))
444 if pkg not in [i[0] for i in self.pip_list()]:
445 res = self.pip_install(pkg, call_log=call_log)
446 if res:
447 status = False
448 return status
449
450 def exec_shell(self,cmd: str, call_log:Optional[Callable[[str], None]] = None, user=""):
451 cmd = self.activate_shell() + "\n" + cmd

Callers 1

simple_prep_envMethod · 0.80

Calls 4

pkg_file_exitsMethod · 0.95
pip_listMethod · 0.95
pip_installMethod · 0.95
formatMethod · 0.45

Tested by

no test coverage detected