def yaml_data_popup(self, Popuopath): """解析yamlcase数据""" function_meta = {"popup_name": None, "element": [], "kwargs": {}} yamldatalist = COM_utilities.read_yaml(Popuopath) for i in range(0, len(yamldatalist)): self.index = i caselist = yamldatalist[i][i]["step"] for k in range(0, len(caselist)): thefunction_meta = self.parse_function(caselist[k]) function_meta["Popupname"] = thefunction_meta['func_name'] function_meta["element"] = thefunction_meta['args'] function_meta["kwargs"] = thefunction_meta['kwargs'] self.popup_list.append(thefunction_meta) MyData.popup_dir[i] = self.popup_list self.popup_list = []
def yaml_data(self, path): """解析yamlcase数据""" function_meta = {"func_name": None, "args": [], "kwargs": {}} yamldata_dir = COM_utilities.read_yaml(path) for i, val in yamldata_dir.items(): dir = {} dir.update({"casename": val["casename"]}) dir.update({"casedec": val["casedec"]}) dir.update({"reportname": val["reportname"]}) dir.update({"caseauthor": val["caseauthor"]}) dir.update({"repeattime": int(val["repeattime"])}) self.Case_info[i] = dir caselist = yamldata_dir[i]["step"] for k in range(0, len(caselist)): function_meta = self.parse_function(caselist[k]) function_meta["func_name"] = function_meta['func_name'] function_meta["args"] = function_meta['args'] function_meta["kwargs"] = function_meta['kwargs'] self.stepdata_list.append(function_meta) self.Case_dir[i] = self.stepdata_list self.stepdata_list = []