]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Rename self.pakfire to self.backend in web and hub
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Oct 2017 11:59:16 +0000 (12:59 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Oct 2017 11:59:16 +0000 (12:59 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hub/handlers.py
src/web/__init__.py
src/web/handlers_base.py
src/web/ui_modules.py

index e98b1b304e97c153277ec5616f47f66566f36f3d..1aad2a056bb3a7cc39671220c5116dc7e14cee6d 100644 (file)
@@ -36,9 +36,9 @@ class BaseHandler(LongPollMixin, tornado.web.RequestHandler):
        @property
        def backend(self):
                """
-                       Shortcut handler to pakfire instance.
+                       Shortcut handler to pakfire instance
                """
-               return self.application.pakfire
+               return self.application.backend
 
        def get_basic_auth_credentials(self):
                """
index 194d5ced38c4441cddf23b200007b400b6d35529..0abd0d9693d32beed62e2ae4c5431a1c35102fad 100644 (file)
@@ -10,6 +10,7 @@ import tornado.options
 import tornado.web
 
 from .. import Backend
+from ..decorators import *
 
 from . import handlers_api
 
@@ -22,8 +23,6 @@ tornado.options.parse_command_line()
 
 class Application(tornado.web.Application):
        def __init__(self):
-               self.__pakfire = None
-
                settings = dict(
                        debug = tornado.options.options.debug,
                        gzip  = True,
@@ -244,12 +243,12 @@ class Application(tornado.web.Application):
 
                logging.info("Successfully initialied application")
 
-       @property
-       def pakfire(self):
-               if self.__pakfire is None:
-                       self.__pakfire = Backend()
-
-               return self.__pakfire
+       @lazy_property
+       def backend(self):
+               """
+                       Backend connection
+               """
+               return Backend()
 
        def __del__(self):
                logging.info("Shutting down application")
index 19d5c2a561ee9bfa2dffa0e54f81749818343a15..ee79e1842ae8ed920730908fba0c17b0414385ec 100644 (file)
@@ -112,7 +112,7 @@ class BaseHandler(tornado.web.RequestHandler):
 
        @property
        def pakfire(self):
-               return self.application.pakfire
+               return self.application.backend
 
        @property
        def arches(self):
index 4bdb0eeceed4df71a3106c72a6d7187e8aee217b..7279c3c065fe4c3afe41db05c22e7fc6299f2238 100644 (file)
@@ -17,7 +17,7 @@ from ..constants import *
 class UIModule(tornado.web.UIModule):
        @property
        def pakfire(self):
-               return self.handler.application.pakfire
+               return self.handler.application.backend
 
        @property
        def settings(self):