heat template: get_param to get value from JSON param.

本文介绍了一种从网络映射中获取特定参数的方法。通过示例展示了如何使用get_param函数从预定义的网络映射(net_map2)中提取值。具体来说,通过调用get_param并传递网络映射和键值('0')来获取对应的值('jegaa')。


   net_map2: {
       "0": "jegaa",
       "1": "barackz",
   }
   
       netWork:
        value: {get_param: [net_map2, "0"]}

转载于:https://www.cnblogs.com/double12gzh/p/10166219.html

def _get_ai_params_from_item(self, type_, d, document_type, scl_path, scl_sheet_name, old_path, new_path, idx): """ 将vs json item转换为AI判定需要的json item :param type_: :param d: :param document_type: :param scl_path: :param scl_sheet_name: :param old_path: :param new_path: :param idx: :return: """ if type_ == ExcelParseType.MULTILINGUAL.value: old_, new_ = {}, {} if d.get('diff_cols'): col_names = d['diff_cols'] if d.get("old", []): for col_info in d['old']: if self.extract_row_column(col_info['index'])[1] in col_names: if 'index' not in old_: old_['index'] = col_info['index'] if 'content' not in old_: old_['content'] = '' if 'headers' not in old_: old_['headers'] = [] old_['content'] += ',' + col_info['content'] old_['headers'].extend(col_info['headers']) if d.get("new", []): for col_info in d['new']: if self.extract_row_column(col_info['index'])[1] in col_names: if 'index' not in new_: new_['index'] = col_info['index'] if 'content' not in new_: new_['content'] = '' if 'headers' not in new_: new_['headers'] = [] new_['content'] += ',' + col_info['content'] new_['headers'].extend(col_info['headers']) elif type_ in [ ExcelParseType.WORD_SP.value, ExcelParseType.WORD_GPF.value, ExcelParseType.WORD_ILLOUT.value, ExcelParseType.WORD_SYSIND.value, ExcelParseType.WORD_ENG.value, ExcelParseType.WORD_FUEL.value ]: # 将list、dict转为str if 'old' in d: d['old']['content'] = self._word_content_to_str(d.get("old", {}).get('content', '')) if 'new' in d: d['new']['content'] = self._word_content_to_str(d.get("new", {}).get('content', '')) old_ = d.get("old", {}) new_ = d.get("new", {}) else: old_ = d.get("old", {}) new_ = d.get("new", {}) chapter = ""
09-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值