Updated for sbo queries

This commit is contained in:
Dimitris Zlatanidis 2023-04-08 23:10:10 +03:00
parent 5bb3d19072
commit a21d79fff4
12 changed files with 14 additions and 14 deletions

View file

@ -50,7 +50,7 @@ class Dependees(Configs):
if self.utils.is_option(self.flag_bin_repository, self.flags):
self.bin_repo_dict: dict = BinQueries(repo).repository_data()
else:
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
self.sbo_repo_dict: dict = SBoQueries().repository_data()
for pkg in self.packages:
dependees: list = list(self.find_requires(pkg))

View file

@ -53,7 +53,7 @@ class Download(Configs):
location: str = bin_repo_dict[pkg][3]
urls.append(f'{mirror}{location}/{package}')
else:
sbo_repo_dict: dict = SBoQueries('').repository_data()
sbo_repo_dict: dict = SBoQueries().repository_data()
location: str = sbo_repo_dict[pkg][0]
if self.os_arch == 'x86_64' and sbo_repo_dict[pkg][4]:
sources = sbo_repo_dict[pkg][4].split()

View file

@ -288,7 +288,7 @@ class Argparse(Configs):
if self.utils.is_option(self.flag_binaries, self.flags):
self.bin_repo_dict: dict = BinQueries(self.binary_repo).repository_data()
else:
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
self.sbo_repo_dict: dict = SBoQueries().repository_data()
self.check = Check(self.flags, self.sbo_repo_dict, self.bin_repo_dict)
self.check.is_blacklist(self.args[1:])

View file

@ -61,7 +61,7 @@ class RepoInfo(Configs):
if value[0]:
if repo in [self.repos.sbo_repo_name, self.repos.ponce_repo_name]:
count = int(SBoQueries('').count_packages())
count = int(SBoQueries().count_packages())
else:
count = int(BinQueries(repo).count_packages())

View file

@ -11,7 +11,7 @@ class Requires:
def __init__(self, name: str):
__slots__ = 'name'
self.name: str = name
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
self.sbo_repo_dict: dict = SBoQueries().repository_data()
def resolve(self) -> list:
""" Resolve the dependencies. """

View file

@ -13,7 +13,7 @@ from slpkg.models.models import SBoTable, PonceTable
class SBoQueries(Configs):
""" Queries class for the sbo repository. """
def __init__(self, name: str):
def __init__(self, name=None):
__slots__ = 'name'
super(Configs, self).__init__()
self.name: str = name

View file

@ -67,7 +67,7 @@ class SearchPackage(Configs):
else:
# Searching for slackbuilds.
sbo_repos_dict: dict = SBoQueries('').repository_data()
sbo_repos_dict: dict = SBoQueries().repository_data()
names: list = list(sbo_repos_dict.keys())
for package in packages:
for name in names:

View file

@ -41,7 +41,7 @@ class Tracking(Configs):
if self.utils.is_option(self.flag_bin_repository, self.flags):
bin_repo_dict: dict = BinQueries(repo).repository_data()
else:
sbo_repo_dict: dict = SBoQueries('').repository_data()
sbo_repo_dict: dict = SBoQueries().repository_data()
char: str = f' {self.llc}{self.hl}'
sp: str = ' ' * 4

View file

@ -32,7 +32,7 @@ class Upgrade(Configs):
if self.repo_for_binaries:
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
else:
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
self.sbo_repo_dict: dict = SBoQueries().repository_data()
logging.basicConfig(filename=str(LoggingConfig.log_file),
filemode='w',

View file

@ -113,7 +113,7 @@ class Utilities:
def read_sbo_build_tag(self, sbo: str) -> str:
""" Returns build tag from .SlackBuild file. """
build: str = ''
sbo_repo_dict: dict = SBoQueries('').repository_data()
sbo_repo_dict: dict = SBoQueries().repository_data()
location: str = sbo_repo_dict[sbo][0]
sbo_script = Path(self.repos.sbo_repo_path, location, sbo, f'{sbo}.SlackBuild')
@ -202,7 +202,7 @@ class Utilities:
bin_repo_dict: dict = BinQueries(repo).repository_data()
packages += list(bin_repo_dict.keys())
else:
sbo_repo_dict: dict = SBoQueries('').repository_data()
sbo_repo_dict: dict = SBoQueries().repository_data()
packages += list(sbo_repo_dict.keys())
return packages

View file

@ -49,7 +49,7 @@ class ViewPackage(Configs):
def slackbuild(self, slackbuilds: list) -> None:
""" View the packages from the repository. """
slackbuilds: list = self.utils.apply_package_pattern(self.flags, slackbuilds)
sbo_repo_dict: dict = SBoQueries('').repository_data()
sbo_repo_dict: dict = SBoQueries().repository_data()
for sbo in slackbuilds:

View file

@ -49,7 +49,7 @@ class ViewMessage(Configs):
if self.utils.is_option(self.flag_bin_repository, flags):
self.bin_repo_dict: dict = BinQueries(self.repo).repository_data()
else:
self.sbo_repo_dict: dict = SBoQueries('').repository_data()
self.sbo_repo_dict: dict = SBoQueries().repository_data()
def view_packages(self, package: str, mode: str) -> None:
""" Printing the main packages. """
@ -62,7 +62,7 @@ class ViewMessage(Configs):
repo: str = self.repo
else:
version: str = self.sbo_repo_dict[package][2]
repo: str = SBoQueries('').repo_name()
repo: str = SBoQueries().repo_name()
if mode in ['install', 'download']:
color: str = self.cyan