From: Michael Tremer Date: Fri, 6 Oct 2017 16:03:50 +0000 (+0100) Subject: Rename self.pakfire to self.backend X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=020e0a373d5d3357c840aaf0b0815136f686bf1e;p=pbs.git Rename self.pakfire to self.backend Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/base.py b/src/buildservice/base.py index 077b4905..9a674ce0 100644 --- a/src/buildservice/base.py +++ b/src/buildservice/base.py @@ -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):