Updated for table select

This commit is contained in:
Dimitris Zlatanidis 2023-05-05 11:26:42 +03:00
parent 7ab0bd66d4
commit 87698f877f

View file

@ -11,17 +11,19 @@ from slpkg.models.models import SBoTable, PonceTable
class SBoQueries(Configs):
""" Queries class for the sbo repository. """
def __init__(self):
def __init__(self, repository: str):
__slots__ = 'repository'
super(Configs, self).__init__()
self.session = Session
self.repos = Repositories()
self.utils = Utilities()
# Switch between sbo and ponce repository.
self.sbo_table = SBoTable
if self.repos.ponce_repo:
self.sbo_table = PonceTable
table: dict = {
self.repos.sbo_repo_name: SBoTable,
self.repos.ponce_repo_name: PonceTable
}
self.sbo_table: str = table[repository]
def repository_data(self) -> dict:
""" Returns a dictionary with the repository data. """