Improve speed

This commit is contained in:
Dimitris Zlatanidis 2023-04-01 14:31:10 +03:00
parent 09e8d6e616
commit a48e35876c

View file

@ -46,6 +46,7 @@ class RepoInfo(Configs):
count: int = 0 count: int = 0
status: str = 'Disabled' status: str = 'Disabled'
color: str = self.red color: str = self.red
if value[0]: if value[0]:
enabled += 1 enabled += 1
status: str = 'Enabled' status: str = 'Enabled'
@ -58,25 +59,11 @@ class RepoInfo(Configs):
if last is None: if last is None:
last: tuple = ('',) last: tuple = ('',)
packages: dict = {
self.repos.sbo_repo_name: SBoQueries('').count_packages(),
self.repos.ponce_repo_name: SBoQueries('').count_packages(),
self.repos.alien_repo_name: BinQueries('', repo).count_packages(),
self.repos.multilib_repo_name: BinQueries('', repo).count_packages(),
self.repos.restricted_repo_name: BinQueries('', repo).count_packages(),
self.repos.gnome_repo_name: BinQueries('', repo).count_packages(),
self.repos.msb_repo_name: BinQueries('', repo).count_packages(),
self.repos.conraid_repo_name: BinQueries('', repo).count_packages(),
self.repos.slackonly_repo_name: BinQueries('', repo).count_packages(),
self.repos.ponce_bin_repo_name: BinQueries('', repo).count_packages(),
self.repos.salixos_repo_name: BinQueries('', repo).count_packages(),
self.repos.salixos_extra_repo_name: BinQueries('', repo).count_packages(),
self.repos.slackel_repo_name: BinQueries('', repo).count_packages(),
self.repos.slint_repo_name: BinQueries('', repo).count_packages()
}
if value[0]: if value[0]:
count: int = packages[repo] if repo in [self.repos.sbo_repo_name, self.repos.ponce_repo_name]:
count = int(SBoQueries('').count_packages())
else:
count = int(BinQueries('', repo).count_packages())
total_packages += count total_packages += count