检查用户部署方式的可行性 @author baozi <202-02-22> @param: values ( dict ): 用户输入参数的规范化数据 @return msg
(values)
| 412 | |
| 413 | @staticmethod |
| 414 | def __check_feasibility(values): |
| 415 | """检查用户部署方式的可行性 |
| 416 | @author baozi <202-02-22> |
| 417 | @param: |
| 418 | values ( dict ): 用户输入参数的规范化数据 |
| 419 | @return msg |
| 420 | """ |
| 421 | re_v = re.compile(r"\s+(?P<ver>[23]\.\d+(\.\d+)?)\s*") |
| 422 | version_res = re_v.search(values["version"]) |
| 423 | if not version_res: |
| 424 | return None |
| 425 | version = version_res.group("ver") |
| 426 | xsgi = values["xsgi"] |
| 427 | framework = values["framework"] |
| 428 | stype = values["stype"] |
| 429 | if framework == "sanic" and [int(i) for i in version.split('.')[:2]] < [3, 7]: |
| 430 | return "sanic框架不支持python3.7以下的版本" |
| 431 | if xsgi == "asgi" and stype == "uwsgi": |
| 432 | return "uWsgi服务框架不支持asgi协议" |
| 433 | |
| 434 | |
| 435 | def simple_prep_env(self, values: dict) -> Optional[bool]: |
no test coverage detected