diff --git a/slpkg/binary/dependency.py b/slpkg/binary/dependency.py index 21fcec5d..a2928b15 100644 --- a/slpkg/binary/dependency.py +++ b/slpkg/binary/dependency.py @@ -35,7 +35,7 @@ class Dependencies: """ def __init__(self, repo): self.repo = repo - self.black = BlackList().get_black() + self.black = BlackList().get() self.dep_results = [] self.meta = _meta_ diff --git a/slpkg/binary/install.py b/slpkg/binary/install.py index aadce137..aa2a781a 100644 --- a/slpkg/binary/install.py +++ b/slpkg/binary/install.py @@ -48,7 +48,7 @@ from slpkg.binary.repo_init import RepoInit from slpkg.binary.dependency import Dependencies -class BinaryInstall(BlackList, Utils): +class BinaryInstall(Utils): """Installs binaries packages with all dependencies from repository """ @@ -83,7 +83,7 @@ class BinaryInstall(BlackList, Utils): for name in self.data[0]: self.repo_pkg_names.append(split_package(name)[0]) - self.blacklist = list(self.get_black()) + self.blacklist = BlackList().get() self.matching = False def init_flags(self): diff --git a/slpkg/binary/search.py b/slpkg/binary/search.py index 31f24b2b..1b609a94 100644 --- a/slpkg/binary/search.py +++ b/slpkg/binary/search.py @@ -37,7 +37,7 @@ def search_pkg(name, repo): text = utils.read_file(_meta_.lib_path + f"{repo}_repo/PACKAGES.TXT") PACKAGES_TXT = list(utils.package_name(text)) - blacklist = list(black.get_black()) + blacklist = black.get() if name in PACKAGES_TXT and name not in blacklist: return name diff --git a/slpkg/main.py b/slpkg/main.py index a197928e..fb0e31b7 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -66,13 +66,14 @@ from slpkg.binary.check import pkg_upgrade from slpkg.binary.install import BinaryInstall -class ArgParse(BlackList): +class ArgParse: def __init__(self, args): super().__init__() self.args = args self.meta = _meta_ self.msg = Msg() + self.blacklist = BlackList().get() self.commands = [ "update", "upgrade", @@ -584,7 +585,7 @@ class ArgParse(BlackList): elif (len(self.args) == 2 and self.args[0] in options and flag[1] in self.args): self.args.remove(flag[1]) - self.black_remove(list(self.get_black())) + self.black_remove(self.blacklist) elif (len(self.args) > 2 and self.args[0] in options and flag[1] in self.args): diff --git a/slpkg/sbo/check.py b/slpkg/sbo/check.py index 025c5866..f70adb9a 100644 --- a/slpkg/sbo/check.py +++ b/slpkg/sbo/check.py @@ -42,7 +42,7 @@ def sbo_upgrade(skip, flag): msg.checking() upgrade_names = [] data = SboQuery(name="").names() - blacklist = list(black.get_black()) + blacklist = black.get() for pkg in sbo_list(): name = split_package(pkg)[0] diff --git a/slpkg/sbo/network.py b/slpkg/sbo/network.py index 8cf7063e..019e9a04 100644 --- a/slpkg/sbo/network.py +++ b/slpkg/sbo/network.py @@ -48,7 +48,7 @@ from slpkg.sbo.slack_find import slack_package from slpkg.slack.slack_version import slack_ver -class SBoNetwork(BlackList, Utils): +class SBoNetwork(Utils): """View SBo site in the terminal and also read, build or install packages """ @@ -103,7 +103,7 @@ class SBoNetwork(BlackList, Utils): """View SlackBuild package, read or install them from slackbuilds.org """ - if self.sbo_url and self.name not in self.get_black(): + if self.sbo_url and self.name not in BlackList().get(): self.prgnam = f"{self.name}-{self.sbo_version}" self.view_sbo() diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 05013395..e6a12daf 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -47,7 +47,7 @@ from slpkg.sbo.dependencies import Requires from slpkg.sbo.slack_find import slack_package -class SBoInstall(BlackList, Utils): +class SBoInstall(Utils): """Build and install SBo packages with all dependencies """ def __init__(self, slackbuilds, flag): @@ -80,7 +80,7 @@ class SBoInstall(BlackList, Utils): self.count_uni = 0 self.msg.reading() self.data = SboQuery(name="").names() - self.blacklist = list(self.get()) + self.blacklist = BlackList().get() def init_flags(self): """Flags initialization diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index f5dbaf59..797042a2 100644 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -52,7 +52,7 @@ from slpkg.slack.mirrors import mirrors from slpkg.slack.slack_version import slack_ver -class Patches(BlackList, Utils): +class Patches(Utils): """Upgrades distribution from the official Slackware mirrors """ def __init__(self, skip, flag): @@ -78,6 +78,7 @@ class Patches(BlackList, Utils): self.comp_sum = [] self.uncomp_sum = [] self.msg.checking() + self.blacklist = BlackList().get() if self.version == "stable": self.PACKAGES_TXT = URL(mirrors("PACKAGES.TXT", @@ -153,7 +154,7 @@ class Patches(BlackList, Utils): """Stores and returns packages for upgrading """ data = repo_data(self.PACKAGES_TXT, "slack", self.flag) - black = list(self.get_black()) + for name, loc, comp, uncomp in zip(data[0], data[1], data[2], data[3]): repo_pkg_name = split_package(name)[0] @@ -162,7 +163,7 @@ class Patches(BlackList, Utils): pkg_ver = split_package(name)[1] if (GetFromInstalled(pkg_name).name() and - repo_pkg_name not in black and + repo_pkg_name not in self.blacklist and repo_pkg_name not in self.skip and parse_version(pkg_ver) > parse_version( GetFromInstalled(pkg_name).version())): @@ -178,7 +179,7 @@ class Patches(BlackList, Utils): self.count_upg -= 1 elif (not os.path.isfile(self.meta.pkg_path + name[:-4]) and - repo_pkg_name not in black and + repo_pkg_name not in self.blacklist and repo_pkg_name not in self.skip): self.dwn_links.append(f"{mirrors('', '')}{loc}/{name}") self.comp_sum.append(comp) diff --git a/slpkg/tracking.py b/slpkg/tracking.py index 8d97584b..a7b7dc67 100644 --- a/slpkg/tracking.py +++ b/slpkg/tracking.py @@ -37,12 +37,13 @@ from slpkg.binary.search import search_pkg from slpkg.binary.dependency import Dependencies -class TrackingDeps(BlackList): +class TrackingDeps: """Views tree of dependencies and also highlights packages with the colour green if already installed and the colour red if not installed. """ + def __init__(self, name, repo, flag): super().__init__() self.name = name @@ -57,6 +58,7 @@ class TrackingDeps(BlackList): self.endc = self.meta.color["ENDC"] self.requires = [] self.deps_dict = {} + self.blacklist = BlackList() self.init_flags() def init_flags(self): @@ -156,7 +158,7 @@ class TrackingDeps(BlackList): self.find_pkg = search_pkg(self.name, self.repo) if self.find_pkg: - self.black = list(self.get_black()) + self.black = list(self.blacklist.get()) self.dependencies = Dependencies( self.repo, self.black).binary(self.name, self.flag)