本文整理匯總了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)