Last active
December 31, 2015 00:59
-
-
Save jaapz/7910616 to your computer and use it in GitHub Desktop.
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
from axel import Event | |
error = Event(asynch=True) |
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
import events | |
from sms import send | |
def sms_event_handler(sender, *args, **kwargs): | |
""" Send an sms when the errorevent occurs """ | |
send(61234512, 'iets ging fout biatch') | |
events.error.handle(sms_event_handler) |
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
import events | |
for log in logs: | |
if log.value > max_value: | |
events.error.fire(my_argument='fout fout fout fout') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment