From 68f28caaabe2e364b633a7526e54df913fc96bb0 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Mon, 23 Jan 2023 21:28:00 +0200 Subject: [PATCH] Switch for inheritance --- slpkg/upgrade.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/slpkg/upgrade.py b/slpkg/upgrade.py index 63680ca2..0a79da6b 100644 --- a/slpkg/upgrade.py +++ b/slpkg/upgrade.py @@ -8,12 +8,12 @@ from slpkg.dependencies import Requires from slpkg.configs import Configs -class Upgrade: +class Upgrade(Configs, Utilities): """ Upgrade the installed packages. """ def __init__(self): - self.utils = Utilities() - self.conf = Configs() + super(Configs, self).__init__() + super(Utilities, self).__init__() def packages(self): """ Compares version of packages and returns the maximum. """ @@ -21,14 +21,14 @@ class Upgrade: black = Blacklist().get() upgrade, requires = [], [] - installed = self.utils.all_installed(f'*{self.conf.sbo_repo_tag}') + installed = self.all_installed(f'*{self.sbo_repo_tag}') for pkg in installed: - inst_pkg_name = self.utils.split_installed_pkg(pkg)[0] + inst_pkg_name = self.split_installed_pkg(pkg)[0] if inst_pkg_name not in black and inst_pkg_name in repo_packages: - if self.utils.is_repo_version_bigger(inst_pkg_name): + if self.is_repo_version_bigger(inst_pkg_name): requires += Requires(inst_pkg_name).resolve() upgrade.append(inst_pkg_name)