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

Method __check_args

class/projectModel/pythonModel.py:617–794  ·  view source on GitHub ↗

检查输入的参数 @author baozi <202-02-22> @param: get ( dict ): 创建Python项目时的请求 @return dict : 规范化的请求参数 参数列表: pjname port stype path user requirement_path env_list e

(self, get)

Source from the content-addressed store, hash-verified

615
616 # 检查输入参数
617 def __check_args(self, get):
618 """检查输入的参数
619 @author baozi <202-02-22>
620 @param:
621 get ( dict ): 创建Python项目时的请求
622 @return dict : 规范化的请求参数
623 参数列表:
624 pjname
625 port
626 stype
627 path
628 user
629 requirement_path
630 env_list
631 env_file
632 framework
633
634 可能有:
635 # venv_path
636 # version
637
638 venv_path 和 version 替换为 python_bin
639
640 initialize
641
642 project_cmd
643
644 xsgi
645 rfile
646 call_app
647
648 is_pypy
649 logpath
650 auto_run
651 """
652
653 project_cmd = ""
654 xsgi = "wsgi"
655 rfile = ""
656 call_app = "app"
657 user = "root"
658 initialize = ""
659 try:
660 pjname = get.pjname.strip()
661 port = get.port
662 stype = get.stype.strip()
663 path = get.path.strip().rstrip("/")
664 if re.search(r"\s", path):
665 return False, public.returnMsg(False, "项目路径不能包含空格")
666 python_bin = get.get("python_bin/s", "")
667 if not python_bin or not os.path.exists(python_bin):
668 return False, public.returnMsg(False, "python环境选择错误")
669 if "user" in get and get.user.strip():
670 user = get.user.strip()
671 if "requirement_path" in get and get.requirement_path.strip():
672 requirement_path = get.requirement_path.strip()
673 else:
674 requirement_path = None

Callers 1

CreateProjectMethod · 0.95

Calls 14

_check_portMethod · 0.95
get_system_user_listMethod · 0.95
get_env_py_pathMethod · 0.95
_check_project_existMethod · 0.95
EnvironmentManagerClass · 0.90
returnMsgMethod · 0.80
dirnameMethod · 0.80
searchMethod · 0.45
getMethod · 0.45
existsMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected