本文整理汇总了Python中toscaparser.common.exception.ExceptionCollector.getExceptionsReport方法的典型用法代码示例。如果您正苦于以下问题:Python ExceptionCollector.getExceptionsReport方法的具体用法?Python ExceptionCollector.getExceptionsReport怎么用?Python ExceptionCollector.getExceptionsReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toscaparser.common.exception.ExceptionCollector
的用法示例。
在下文中一共展示了ExceptionCollector.getExceptionsReport方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verify_template
# 需要导入模块: from toscaparser.common.exception import ExceptionCollector [as 别名]
# 或者: from toscaparser.common.exception.ExceptionCollector import getExceptionsReport [as 别名]
def verify_template(self):
if ExceptionCollector.exceptionsCaught():
if self.input_path:
msg=(_('\nThe input "%(path)s" failed validation with '
'the following error(s): \n\n\t')
% {'path': self.input_path}) + '\n\t'.join(ExceptionCollector.getExceptionsReport())
else:
msg=_('\nThe pre-parsed input failed validation with '
'the following error(s): \n\n\t') + '\n\t'.join(ExceptionCollector.getExceptionsReport())
else:
if self.input_path:
msg = (_('The input "%(path)s" successfully passed '
'validation.') % {'path': self.input_path})
else:
msg = _('The pre-parsed input successfully passed validation.')
log.info(msg)
return msg
示例2: verify_template
# 需要导入模块: from toscaparser.common.exception import ExceptionCollector [as 别名]
# 或者: from toscaparser.common.exception.ExceptionCollector import getExceptionsReport [as 别名]
def verify_template(self):
if ExceptionCollector.exceptionsCaught():
raise ValidationError(
message=(_('\nThe input "%(path)s" failed validation with the '
'following error(s): \n\n\t')
% {'path': self.input_path}) +
'\n\t'.join(ExceptionCollector.getExceptionsReport()))
else:
msg = (_('The input "%(path)s" successfully passed validation.') %
{'path': self.input_path})
log.info(msg)
print(msg)