Updated for self

This commit is contained in:
Dimitris Zlatanidis 2023-05-17 23:48:01 +03:00
parent cfb4d6ba45
commit c9e871b4a6

View file

@ -20,6 +20,7 @@ class SearchPackage(Configs):
self.repos = Repositories()
self.matching: int = 0
self.repo_data: dict = {}
self.data_dict: dict = {}
self.is_binary: bool = self.utils.is_binary_repo(repository)
@ -42,21 +43,21 @@ class SearchPackage(Configs):
for repo, item in self.repos.repositories.items():
if item['enable']: # Check if the repository is enabled
if self.utils.is_binary_repo(repo):
data: dict = BinQueries(repo).repository_data()
self.repo_data: dict = BinQueries(repo).repository_data()
else:
data: dict = SBoQueries(repo).repository_data()
self.search_for_the_packages(data, repo)
self.repo_data: dict = SBoQueries(repo).repository_data()
self.search_for_the_packages(repo)
def search_to_the_repository(self) -> None:
if self.is_binary:
data: dict = BinQueries(self.repository).repository_data()
self.repo_data: dict = BinQueries(self.repository).repository_data()
else:
data: dict = SBoQueries(self.repository).repository_data()
self.search_for_the_packages(data, self.repository)
self.repo_data: dict = SBoQueries(self.repository).repository_data()
self.search_for_the_packages(self.repository)
def search_for_the_packages(self, data: dict, repo: str) -> None:
def search_for_the_packages(self, repo: str) -> None:
for package in self.packages:
for name, data_pkg in data.items():
for name, data_pkg in self.repo_data.items():
if self.option_for_no_case:
package: str = package.lower()