Download:
child 170:ed9d9ccb3b4c
parent 168:fc6392f4acdb
169:216b7662fea9
Anton Shestakov <av6@dwimlabs.net>, Thu, 21 Jul 2016 01:09:19 +0800
queue: create a BaseHookHandler with rconn property

1 файлов изменено, 7 вставок(+), 5 удалений(-) [+]
hooks-queue.py file | annotate | diff | comparison | revisions
--- a/hooks-queue.py Wed Jul 20 09:34:13 2016 +0800
+++ b/hooks-queue.py Thu Jul 21 01:09:19 2016 +0800
@@ -18,7 +18,13 @@
options.logging = None
-class BitbucketHookHandler(RequestHandler):
+class BaseHookHandler(RequestHandler):
+ @property
+ def rconn(self):
+ return self.application.rconn
+
+
+class BitbucketHookHandler(BaseHookHandler):
def post(self):
payload = json.loads(self.request.body)
base = {
@@ -45,10 +51,6 @@
self.finish({'result': 'OK', 'queued': len(hashes)})
- @property
- def rconn(self):
- return self.application.rconn
-
class CandolintHooks(Application):
def __init__(self, rconn, debug):