本文整理汇总了Python中srctools.Property.value方法的典型用法代码示例。如果您正苦于以下问题:Python Property.value方法的具体用法?Python Property.value怎么用?Python Property.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类srctools.Property
的用法示例。
在下文中一共展示了Property.value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_result
# 需要导入模块: from srctools import Property [as 别名]
# 或者: from srctools.Property import value [as 别名]
def setup_result(res_list: List[Property], result: Property, source: Optional[str]='') -> None:
"""Helper method to perform result setup."""
func = RESULT_SETUP.get(result.name)
if func:
# noinspection PyBroadException
try:
result.value = func(VMF, result)
except:
# Print the source of the condition if if fails...
LOGGER.exception(
'Error in {} setup:',
source or 'condition',
)
if utils.DEV_MODE:
# Crash so this is immediately noticable..
utils.quit_app(1)
else:
# In release, just skip this one - that way it's
# still hopefully possible to run the game.
result.value = None
if result.value is None:
# This result is invalid, remove it.
res_list.remove(result)