mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Updated for table select
This commit is contained in:
parent
7ab0bd66d4
commit
87698f877f
1 changed files with 7 additions and 5 deletions
|
@ -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. """
|
||||
|
|
Loading…
Add table
Reference in a new issue