获取项目的配置信息 @author baozi <202-02-22> @param: name_id ( str|id ): 项目名称或者项目id @return dict_onj: 项目信息
(self, name_id)
| 316 | return res |
| 317 | |
| 318 | def _get_project_conf(self, name_id) -> Union[Dict, bool]: |
| 319 | """获取项目的配置信息 |
| 320 | @author baozi <202-02-22> |
| 321 | @param: |
| 322 | name_id ( str|id ): 项目名称或者项目id |
| 323 | @return dict_onj: 项目信息 |
| 324 | """ |
| 325 | if isinstance(name_id, int): |
| 326 | _id = name_id |
| 327 | _name = None |
| 328 | else: |
| 329 | _id = None |
| 330 | _name = name_id |
| 331 | data = public.M('sites').where('project_type=? AND (name = ? OR id = ?)', ('Python', _name, _id)).field( |
| 332 | 'name,path,status,project_config').find() |
| 333 | if not data: return False |
| 334 | project_conf = json.loads(data['project_config']) |
| 335 | if "env_list" not in project_conf: |
| 336 | project_conf["env_list"] = [] |
| 337 | if "env_file" not in project_conf: |
| 338 | project_conf["env_file"] = "" |
| 339 | if "call_app" not in project_conf: |
| 340 | project_conf["call_app"] = "" |
| 341 | if not os.path.exists(data["path"]): |
| 342 | self.__stop_project(project_conf) |
| 343 | return project_conf |
| 344 | |
| 345 | def _get_vp_pip(self, vpath): |
| 346 | """获取虚拟环境下的pip |
no test coverage detected