import flask
import registry

app = flask.Flask(__name__)

def get_registry():
    r = getattr(flask.g, '_registry', None)
    if r is None:
        r = flask.g._registry = registry.Registry("hooks.json")

    return r


@app.route("/hook/<repo>", methods=['POST'])
def hook(repo):
    branch = flask.request.json["ref"].split("/")[-1]
    sha    = flask.request.json["head"]

    get_registry().notify(repo, branch, sha)

    return flask.jsonify(status="ok")

if __name__ == "__main__":
    app.run(debug=True, host='0.0.0.0', port=8080)

@@ -275,16 +275,185 @@
 (repo):%0A
+    if flask.request.headers%5B'X-GitHub-Event'%5D == 'ping':%0A        return flask.jsonify(zen_level=%22super%22)%0A%0A    if flask.request.headers%5B'X-GitHub-Event'%5D == 'push':%0A    
     bran
@@ -502,16 +502,20 @@
 -1%5D%0A    
+ 
+   
 sha    =
@@ -547,16 +547,20 @@
 %22%5D%0A%0A    
+   
+ 
 get_regi
@@ -593,16 +593,20 @@
 , sha)%0A%0A
+    
     retu

Add support for github ping event