Download:
child 226:0e10087ef94f
parent 224:ce4f062fce9d
225:ada00fa1bf8b
Anton Shestakov <av6@dwimlabs.net>, Wed, 24 Aug 2016 21:26:24 +0800
queue: move option creation to main() to help with tests

1 файлов изменено, 6 вставок(+), 7 удалений(-) [+]
hooks-queue.py file | annotate | diff | comparison | revisions
--- a/hooks-queue.py Wed Aug 24 21:22:05 2016 +0800
+++ b/hooks-queue.py Wed Aug 24 21:26:24 2016 +0800
@@ -12,12 +12,6 @@
from candolint.utils import lookup_option, timestamp
-define('listen', metavar='IP', default='127.0.0.1')
-define('port', metavar='PORT', default=8034, type=int)
-define('xheaders', metavar='True|False', default=False, type=bool)
-options.logging = None
-
-
class BaseHookHandler(RequestHandler):
@property
def rconn(self):
@@ -103,7 +97,7 @@
class CandolintHooks(Application):
- def __init__(self, rconn, debug):
+ def __init__(self, rconn, debug=False):
handlers = [
URLSpec(r'/bitbucket', BitbucketHookHandler),
URLSpec(r'/github', GithubHookHandler),
@@ -118,6 +112,11 @@
def main():
+ define('listen', metavar='IP', default='127.0.0.1')
+ define('port', metavar='PORT', default=8034, type=int)
+ define('xheaders', metavar='True|False', default=False, type=bool)
+ options.logging = None
+
parser = ArgumentParser(argument_default=SUPPRESS)
parser.add_argument(
'-c', '--config', type=FileType('r'),