mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-16 03:41:11 +01:00
Fixed for count
This commit is contained in:
parent
df1d32f5c9
commit
121d8f39c1
1 changed files with 7 additions and 2 deletions
|
@ -7,7 +7,8 @@ from slpkg.configs import Configs
|
||||||
from slpkg.utilities import Utilities
|
from slpkg.utilities import Utilities
|
||||||
from slpkg.repositories import Repositories
|
from slpkg.repositories import Repositories
|
||||||
from slpkg.models.models import session as Session
|
from slpkg.models.models import session as Session
|
||||||
from slpkg.models.models import LastRepoUpdated, SBoTable, BinariesTable
|
from slpkg.models.models import (LastRepoUpdated, SBoTable,
|
||||||
|
PonceTable, BinariesTable)
|
||||||
|
|
||||||
|
|
||||||
class RepoInfo(Configs):
|
class RepoInfo(Configs):
|
||||||
|
@ -38,11 +39,15 @@ class RepoInfo(Configs):
|
||||||
self.print_the_repositories_information()
|
self.print_the_repositories_information()
|
||||||
|
|
||||||
def count_the_packages(self, repository: str) -> int:
|
def count_the_packages(self, repository: str) -> int:
|
||||||
|
sbo_table: dict = {
|
||||||
|
self.repos.sbo_repo_name: SBoTable,
|
||||||
|
self.repos.ponce_repo_name: PonceTable
|
||||||
|
}
|
||||||
if self.utils.is_binary_repo(repository):
|
if self.utils.is_binary_repo(repository):
|
||||||
count = self.session.query(BinariesTable).where(
|
count = self.session.query(BinariesTable).where(
|
||||||
BinariesTable.repo == repository).count()
|
BinariesTable.repo == repository).count()
|
||||||
else:
|
else:
|
||||||
count = self.session.query(SBoTable.id).count()
|
count = self.session.query(sbo_table[repository].id).count()
|
||||||
|
|
||||||
self.total_packages += count
|
self.total_packages += count
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue