Switched to where

This commit is contained in:
Dimitris Zlatanidis 2023-03-26 17:48:37 +03:00
parent c83b46308d
commit b9720b44a7

View file

@ -29,8 +29,9 @@ class BinQueries(Configs):
def all_name_packages(self) -> list: def all_name_packages(self) -> list:
""" Returns all the names of the binaries packages. """ """ Returns all the names of the binaries packages. """
print(self.bin_repo)
pkgs: tuple = self.session.query( pkgs: tuple = self.session.query(
BinariesTable.name, BinariesTable.name).where(
BinariesTable.repo.in_(self.bin_repo)).all() BinariesTable.repo.in_(self.bin_repo)).all()
return [pkg[0] for pkg in pkgs] return [pkg[0] for pkg in pkgs]
@ -38,7 +39,7 @@ class BinQueries(Configs):
def all_name_binaries_packages(self) -> list: def all_name_binaries_packages(self) -> list:
""" Returns all the binaries packages. """ """ Returns all the binaries packages. """
pkgs: tuple = self.session.query( pkgs: tuple = self.session.query(
BinariesTable.package, BinariesTable.package).where(
BinariesTable.repo.in_(self.bin_repo)).all() BinariesTable.repo.in_(self.bin_repo)).all()
return [pkg[0] for pkg in pkgs] return [pkg[0] for pkg in pkgs]
@ -56,7 +57,7 @@ class BinQueries(Configs):
""" Returns the package name. """ """ Returns the package name. """
pkg: tuple = self.session.query( pkg: tuple = self.session.query(
BinariesTable.name).filter( BinariesTable.name).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if pkg: if pkg:
@ -67,7 +68,7 @@ class BinQueries(Configs):
""" Returns the binary package. """ """ Returns the binary package. """
pkg: tuple = self.session.query( pkg: tuple = self.session.query(
BinariesTable.package).filter( BinariesTable.package).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if pkg: if pkg:
@ -78,7 +79,7 @@ class BinQueries(Configs):
""" Returns the binary package checksum. """ """ Returns the binary package checksum. """
md5: tuple = self.session.query( md5: tuple = self.session.query(
BinariesTable.checksum).filter( BinariesTable.checksum).filter(
BinariesTable.package == self.name, BinariesTable.package == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if md5: if md5:
@ -89,7 +90,7 @@ class BinQueries(Configs):
""" Returns the package version. """ """ Returns the package version. """
pkg: tuple = self.session.query( pkg: tuple = self.session.query(
BinariesTable.version).filter( BinariesTable.version).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if pkg: if pkg:
@ -100,7 +101,7 @@ class BinQueries(Configs):
""" Returns the package mirror. """ """ Returns the package mirror. """
mir: tuple = self.session.query( mir: tuple = self.session.query(
BinariesTable.mirror).filter( BinariesTable.mirror).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if mir: if mir:
@ -111,7 +112,7 @@ class BinQueries(Configs):
""" Returns the package location. """ """ Returns the package location. """
loc: tuple = self.session.query( loc: tuple = self.session.query(
BinariesTable.location).filter( BinariesTable.location).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if loc: if loc:
@ -122,7 +123,7 @@ class BinQueries(Configs):
""" Returns the package comp size. """ """ Returns the package comp size. """
size: tuple = self.session.query( size: tuple = self.session.query(
BinariesTable.size_comp).filter( BinariesTable.size_comp).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if size: if size:
@ -133,7 +134,7 @@ class BinQueries(Configs):
""" Returns the package uncomp size. """ """ Returns the package uncomp size. """
size: tuple = self.session.query( size: tuple = self.session.query(
BinariesTable.unsize_comp).filter( BinariesTable.unsize_comp).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if size: if size:
@ -144,7 +145,7 @@ class BinQueries(Configs):
""" Returns the package required. """ """ Returns the package required. """
req: tuple = self.session.query( req: tuple = self.session.query(
BinariesTable.required).filter( BinariesTable.required).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if req: if req:
@ -155,7 +156,7 @@ class BinQueries(Configs):
""" Returns the package conflicts. """ """ Returns the package conflicts. """
con: tuple = self.session.query( con: tuple = self.session.query(
BinariesTable.conflicts).filter( BinariesTable.conflicts).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if con: if con:
@ -166,7 +167,7 @@ class BinQueries(Configs):
""" Returns the package suggests. """ """ Returns the package suggests. """
sug: tuple = self.session.query( sug: tuple = self.session.query(
BinariesTable.suggests).filter( BinariesTable.suggests).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if sug: if sug:
@ -177,7 +178,7 @@ class BinQueries(Configs):
""" Returns the package description. """ """ Returns the package description. """
desc: tuple = self.session.query( desc: tuple = self.session.query(
BinariesTable.description).filter( BinariesTable.description).filter(
BinariesTable.name == self.name, BinariesTable.name == self.name).where(
BinariesTable.repo.in_(self.bin_repo)).first() BinariesTable.repo.in_(self.bin_repo)).first()
if desc: if desc: