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


Python Report.alert方法代码示例

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


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

示例1: parseResponse

# 需要导入模块: from kol.util import Report [as 别名]
# 或者: from kol.util.Report import alert [as 别名]
    def parseResponse(self):
        hardcoreRoninPattern = PatternManager.getOrCompilePattern('userInHardcoreRonin')
        ignoringPattern = PatternManager.getOrCompilePattern('userIgnoringUs')
        notEnoughItemsPattern = PatternManager.getOrCompilePattern('notEnoughItemsToSend')
        sentMessagePattern = PatternManager.getOrCompilePattern('messageSent')

        if hardcoreRoninPattern.search(self.responseText):
            raise Error.Error("Unable to send items or meat. User is in hardcore or ronin.", Error.USER_IN_HARDCORE_RONIN)
        elif ignoringPattern.search(self.responseText):
            raise Error.Error("Unable to send message. User is ignoring us.", Error.USER_IS_IGNORING)
        elif notEnoughItemsPattern.search(self.responseText):
            raise Error.Error("You don't have enough of one of the items you're trying to send.", Error.ITEM_NOT_FOUND)
        elif sentMessagePattern.search(self.responseText) == None:
            Report.alert("system", "Received unknown response when attempting to send a message.")
            Report.alert("system", self.responseText)
            raise Error.Error("Unknown error", Error.REQUEST_FATAL)
开发者ID:MicN,项目名称:HogBotGit,代码行数:18,代码来源:SendMessageRequest.py

示例2: parseResponse

# 需要导入模块: from kol.util import Report [as 别名]
# 或者: from kol.util.Report import alert [as 别名]
    def parseResponse(self):
        hardcoreRoninPattern = PatternManager.getOrCompilePattern('userInHardcoreRonin')
        ignoringPattern = PatternManager.getOrCompilePattern('userIgnoringUs')
        notEnoughItemsPattern = PatternManager.getOrCompilePattern('notEnoughItemsToSend')
        sentMessagePattern = PatternManager.getOrCompilePattern('messageSent')

        if hardcoreRoninPattern.search(self.responseText):
            raise UserInHardcoreRoninError("Unable to send items or meat. User is in hardcore or ronin.")
        elif ignoringPattern.search(self.responseText):
            raise UserIsIgnoringError("Unable to send message. User is ignoring us.")
        elif notEnoughItemsPattern.search(self.responseText):
            raise NotEnoughItemsError("You don't have enough of one of the items you're trying to send.")
        elif sentMessagePattern.search(self.responseText) == None:
            Report.alert("system", "Received unknown response when attempting to send a message.")
            Report.alert("system", self.responseText)
            raise RequestError("Unknown error")
开发者ID:camperdave,项目名称:pykol,代码行数:18,代码来源:SendMessageRequest.py


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