def send(notif_type, **params):
''' Send hipchat notifications. '''
url = API_BASE_URL.format(
company_name=config()['company_name'],
room_id=config()['room_id'],
auth_token=config()['auth_token']
)
(text, color) = notification.get(
notif_type,
config=get_config(),
notif_config=config(),
create_link=create_link,
**params
)
payload = {
'color': color,
'message': text,
'notify': config()['notify'],
'message_format': 'html'
}
requests.post(url, json=payload)
评论列表
文章目录