]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Rename self.pakfire to self.backend
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Oct 2017 16:03:50 +0000 (17:03 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Oct 2017 16:03:50 +0000 (17:03 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/base.py

index 077b49050cbd616a7a6dd1f9878000929c3fd5ff..9a674ce0a35c7bb8f54fd2a99c55d36f7ebe783b 100644 (file)
@@ -9,15 +9,15 @@ class Object(object):
                This is used to access the global instance of Pakfire
                and hold the database connection.
        """
-       def __init__(self, pakfire, *args, **kwargs):
-               self.pakfire = pakfire
+       def __init__(self, backend, *args, **kwargs):
+               self.backend = backend
 
                # Shortcut to the database.
-               self.db = self.pakfire.db
+               self.db = self.backend.db
 
                # Shortcut to settings.
                if hasattr(self.pakfire, "settings"):
-                       self.settings = self.pakfire.settings
+                       self.settings = self.backend.settings
 
                # Call custom constructor
                self.init(*args, **kwargs)
@@ -28,9 +28,17 @@ class Object(object):
                """
                pass
 
+       @lazy_property
+       def pakfire(self):
+               """
+                       DEPRECATED: This attribute is only kept until
+                       all other code has been updated to use self.backend.
+               """
+               return self.backend
+
        @property
        def geoip(self):
-               return self.pakfire.geoip
+               return self.backend.geoip
 
 
 class DataObject(Object):