-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
20 changed files
with
148 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import asyncio | ||
import json | ||
|
||
from common.config import config | ||
from common import http | ||
|
||
@asyncio.coroutine | ||
def send_message(text, **keys): | ||
async def send_message(text, **keys): | ||
keys['text'] = text | ||
|
||
headers = { | ||
"Content-Type": "application/json", | ||
} | ||
|
||
if config['slack_webhook_url'] is not None: | ||
yield from http.request_coro(config['slack_webhook_url'], method="POST", data=json.dumps(keys), headers=headers) | ||
await http.request_coro(config['slack_webhook_url'], method="POST", data=json.dumps(keys), headers=headers) | ||
|
||
def escape(text): | ||
return text \ | ||
.replace("&", "&") \ | ||
.replace("<", "<") \ | ||
.replace(">", ">") | ||
.replace(">", ">") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.