当前位置: 首页>>代码示例>>Python>>正文


Python Failure.value方法代码示例

本文整理汇总了Python中twisted.python.failure.Failure.value方法的典型用法代码示例。如果您正苦于以下问题:Python Failure.value方法的具体用法?Python Failure.value怎么用?Python Failure.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.python.failure.Failure的用法示例。


在下文中一共展示了Failure.value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parseError

# 需要导入模块: from twisted.python.failure import Failure [as 别名]
# 或者: from twisted.python.failure.Failure import value [as 别名]
 def parseError(self, err, query, instMap):
     err = Failure(err)
     err.value = 'Received %s from query: %s'%(err.value, query)
     log.error(err.getErrorMessage())
     results = {}
     for instances in instMap.values():
         for tables in instances.values():
             for table, props in tables:
                 results[table] = [err,]
     return results
开发者ID:alecsandrb,项目名称:Community-Zenpacks,代码行数:12,代码来源:WMIClient.py

示例2: test_process_done

# 需要导入模块: from twisted.python.failure import Failure [as 别名]
# 或者: from twisted.python.failure.Failure import value [as 别名]
    def test_process_done(self):
        error = Failure(exc_value=Exception())
        error.type = ProcessDone
        error.value = Mock(exitCode=1, message="foobar")

        jobtype = JobType(fake_assignment())
        self.assertEqual(
            jobtype.format_error(error),
            "Process has finished with no apparent errors."
        )
开发者ID:pyfarm,项目名称:pyfarm-agent,代码行数:12,代码来源:test_core_jobtype.py

示例3: test_process_terminated

# 需要导入模块: from twisted.python.failure import Failure [as 别名]
# 或者: from twisted.python.failure.Failure import value [as 别名]
    def test_process_terminated(self):
        error = Failure(exc_value=Exception())
        error.type = ProcessTerminated
        error.value = Mock(exitCode=1, message="foobar")

        jobtype = JobType(fake_assignment())
        self.assertEqual(
            jobtype.format_error(error),
            "Process may have terminated abnormally, please check "
            "the logs.  Message from error "
            "was 'foobar'"
        )
开发者ID:pyfarm,项目名称:pyfarm-agent,代码行数:14,代码来源:test_core_jobtype.py

示例4: parseError

# 需要导入模块: from twisted.python.failure import Failure [as 别名]
# 或者: from twisted.python.failure.Failure import value [as 别名]
 def parseError(self, err, query, instMap):
     if isinstance(err.value, pywbem.cim_http.AuthError):
         msg = 'AuthError: Please check zWinUser and zWinPassword zProperties'
     else:
         msg = 'Received %s from query: %s'%(err.value[1], query)
     err = Failure(err)
     err.value = msg
     log.error(err.getErrorMessage())
     results = {}
     for instances in instMap.values():
         for tables in instances.values():
             for table, props in tables:
                 results[table] = [err]
     return results
开发者ID:alecsandrb,项目名称:Community-Zenpacks,代码行数:16,代码来源:WBEMClient.py


注:本文中的twisted.python.failure.Failure.value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。