feat: breakout formatters into their own plugin-like module to ease additonal formatters
This commit is contained in:
parent
d82a0ba9bd
commit
0d92c378c4
6 changed files with 13 additions and 19 deletions
Binary file not shown.
|
@ -1,8 +1,4 @@
|
|||
import plugins
|
||||
|
||||
|
||||
@plugins.register
|
||||
def github(data, headers):
|
||||
def formatter(data, headers):
|
||||
"""Pretty-print a github notification."""
|
||||
# TODO: Write nice useful formatters. This is only an example.
|
||||
if headers["X-GitHub-Event"] == "push":
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
import plugins
|
||||
|
||||
|
||||
@plugins.register
|
||||
def grafana(data, headers):
|
||||
def formatter(data, headers):
|
||||
"""Pretty-print a grafana notification."""
|
||||
text = ""
|
||||
if "title" in data:
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import plugins
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@plugin.register
|
||||
def pingdom(data, headers):
|
||||
def formatter(data, headers):
|
||||
"""Pretty-print a pingdom notification."""
|
||||
#JSON data formatting was obtained from https://www.pingdom.com/resources/webhooks/
|
||||
check_id = data["check_id"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue