From: Michael Tremer Date: Sat, 7 Oct 2017 12:03:09 +0000 (+0100) Subject: web: More code cleanup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=754243af5fde1a10e92a9063fe94602d0d546413;p=pbs.git web: More code cleanup Signed-off-by: Michael Tremer --- diff --git a/src/web/__init__.py b/src/web/__init__.py index 0abd0d96..70890194 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -22,7 +22,7 @@ tornado.options.define("debug", default=False, help="Run in debug mode", type=bo tornado.options.parse_command_line() class Application(tornado.web.Application): - def __init__(self): + def __init__(self, **_settings): settings = dict( debug = tornado.options.options.debug, gzip = True, @@ -94,13 +94,12 @@ class Application(tornado.web.Application): }, xsrf_cookies = True, ) + settings.update(_settings) # Load translations. tornado.locale.load_gettext_translations(LOCALEDIR, PACKAGE_NAME) - tornado.web.Application.__init__(self, **settings) - - self.add_handlers(r".*", [ + tornado.web.Application.__init__(self, [ # Entry site that lead the user to index (r"/", IndexHandler), @@ -239,7 +238,7 @@ class Application(tornado.web.Application): # API handlers (r"/api/packages/autocomplete", handlers_api.ApiPackagesAutocomplete), - ]) + ], **settings) logging.info("Successfully initialied application")