#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import

from hookit import *

def consume_event(event):
    event.dispatched = True
    event.save()
    return event


def process_events(events):
    for event in events:
        print event
        #consume_event(event)
        #recipe = find_recipe(event)
        #run_recipe(recipe)


if __name__ == '__main__':
    try:
        PushEvent.create_table()
        Recipe.create_table()
    except:
        pass

    events = PushEvent.select().where(PushEvent.dispatched==False)
    process_events(events)

@@ -89,23 +89,540 @@
 rom 
-hookit import *
+flask_peewee.utils import get_dictionary_from_model%0Afrom yapbl import PushBullet%0A%0Afrom hookit import *%0A%0Amsg = '''%0AA github push has been received by our hook system.%0AThe message delivery code was %7Bdelivery_code%7D.%0AThe full repo name is %7Bfull_repo_name%7D%0AAnd the push was done to %7Bref%7D (%7Bhead%7D) by %7Bpusher%7D%0A%0A:)%0A'''%0A%0Aconfig = %7B%0A        'pb_key': 'YOUR_KEY_HERE'%0A        %7D%0A%0Adef pushbullet_reactor(config, context):%0A    key = config.get('pb_key')%0A    pb = PushBullet(key)%0A    pb.push_note('Github event detected', msg.format(**context))%0A%0A
 %0A%0Ade
@@ -794,66 +794,68 @@
     
-#consume_event(event)%0A        #recipe = find_recipe
+pushbullet_reactor(config, get_dictionary_from_model
 (event)
+)
 %0A   
@@ -863,26 +863,27 @@
     
-#run_recipe(recipe
+consume_event(event
 )%0A%0A%0A

Add reactor system