本文整理汇总了Python中safe.utilities.keyword_io.KeywordIO._threshold_to_row方法的典型用法代码示例。如果您正苦于以下问题:Python KeywordIO._threshold_to_row方法的具体用法?Python KeywordIO._threshold_to_row怎么用?Python KeywordIO._threshold_to_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe.utilities.keyword_io.KeywordIO
的用法示例。
在下文中一共展示了KeywordIO._threshold_to_row方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resolve_dict_keywords
# 需要导入模块: from safe.utilities.keyword_io import KeywordIO [as 别名]
# 或者: from safe.utilities.keyword_io.KeywordIO import _threshold_to_row [as 别名]
def resolve_dict_keywords(keywords):
"""Replace dictionary content with html.
:param keywords: The keywords.
:type keywords: dict
:return: New keywords with updated content.
:rtype: dict
"""
for keyword in ['value_map', 'inasafe_fields', 'inasafe_default_values']:
value = keywords.get(keyword)
if value:
value = value.get('content')
value = KeywordIO._dict_to_row(value).to_html()
keywords[keyword]['content'] = value
value_maps = keywords.get('value_maps')
thresholds = keywords.get('thresholds')
if value_maps:
value_maps = value_maps.get('content')
value_maps = KeywordIO._value_maps_row(value_maps).to_html()
keywords['value_maps']['content'] = value_maps
if thresholds:
thresholds = thresholds.get('content')
thresholds = KeywordIO._threshold_to_row(thresholds).to_html()
keywords['thresholds']['content'] = thresholds
return keywords