Updated message for db loading

This commit is contained in:
Dimitris Zlatanidis 2023-05-25 22:56:52 +03:00
parent d9832c265d
commit ba378dd1e9

View file

@ -316,13 +316,13 @@ class Menu(Configs):
f'{args=}, {self.flags=}, {self.repository=}') f'{args=}, {self.flags=}, {self.repository=}')
def load_database(self): def load_database(self):
print('\rDatabase loading... ', end='')
if self.repository != '*' and not self.data: if self.repository != '*' and not self.data:
print('\rDatabase loading... ', end='')
if self.is_binary: if self.is_binary:
self.data: dict = BinQueries(self.repository).repository_data() self.data: dict = BinQueries(self.repository).repository_data()
else: else:
self.data: dict = SBoQueries(self.repository).repository_data() self.data: dict = SBoQueries(self.repository).repository_data()
print(f'{self.yellow}{self.ascii.done}{self.endc}') print(f'{self.yellow}{self.ascii.done}{self.endc}')
def check_for_repositories(self) -> None: def check_for_repositories(self) -> None:
""" Checks combination for binaries use repositories only and if repository exists. """ """ Checks combination for binaries use repositories only and if repository exists. """
@ -642,14 +642,11 @@ class Menu(Configs):
command: str = Menu.search.__name__ command: str = Menu.search.__name__
if len(self.args) >= 2: if len(self.args) >= 2:
self.load_database()
self.check.is_database_empty() self.check.is_database_empty()
packages: list = self.is_file_list_packages() packages: list = self.is_file_list_packages()
if self.utils.is_option(self.flag_no_cases, self.flags) or not self.case_sensitive:
packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data)
if self.utils.is_option(self.flag_searches, self.flags): if self.utils.is_option(self.flag_searches, self.flags):
self.load_database()
packages: list = self.choose.packages(self.data, packages, command) packages: list = self.choose.packages(self.data, packages, command)
pkgs = SearchPackage(self.flags, packages, self.repository) pkgs = SearchPackage(self.flags, packages, self.repository)