本文整理汇总了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)
示例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")