本文整理汇总了Python中lib.GlobalData.pushRetries方法的典型用法代码示例。如果您正苦于以下问题:Python GlobalData.pushRetries方法的具体用法?Python GlobalData.pushRetries怎么用?Python GlobalData.pushRetries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.GlobalData
的用法示例。
在下文中一共展示了GlobalData.pushRetries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PushAlert
# 需要导入模块: from lib import GlobalData [as 别名]
# 或者: from lib.GlobalData import pushRetries [as 别名]
alerts.append(alert)
except Exception as e:
logging.exception("[%s]: Could not parse config." % fileName)
sys.exit(1)
# Sending test messages for the configured alerts.
for alert in alerts:
logging.info("[%s]: Sending message for alert id %d (%s)."
% (fileName, alert["id"], alert["description"]))
globalData.pushRetryTimeout = 5
globalData.pushRetries = 1
subject = "Test message for alert with id %d" % alert["id"]
message = "This is a test message for the alert:\n\n" \
+ "Id: %d\nDescription: %s\n\nCheers,\nalertR" \
% (alert["id"], alert["description"])
# Initialize alert object.
alertObj = PushAlert(globalData)
alertObj.id = alert["id"]
alertObj.description = alert["description"]
alertObj.username = alert["username"]
alertObj.password = alert["password"]
alertObj.channel = alert["channel"]
alertObj.encSecret = alert["encSecret"]
alertObj.templateFile = alert["templateFile"]