(self, call_log:Optional[Callable[[str], None]] = None)
| 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 |
no test coverage detected