Fixed for typing hints

This commit is contained in:
Dimitris Zlatanidis 2023-04-04 19:48:01 +03:00
parent ee23c5bfbf
commit 0766d508b7
4 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,7 @@
4.7.4 - 04/04/2023
Fixed:
- Python typing hints
4.7.3 - 03/04/2023
Fixed:
- Option -B for -u, update and -c, check-updates commands

View file

@ -24,7 +24,7 @@ class BinQueries(Configs):
if self.name in self.black.packages():
self.name: str = ''
def count_packages(self) -> list:
def count_packages(self) -> int:
""" Counts the number of the packages. """
count = self.session.query(
BinariesTable.id).where(

View file

@ -1,6 +1,8 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from typing import Generator
from slpkg.repositories import Repositories
from slpkg.binaries.queries import BinQueries
@ -13,7 +15,7 @@ class Required:
self.name: str = name
self.repo: str = repo
self.repos = Repositories()
self.repo_package_names: list = BinQueries(
self.repo_package_names: Generator = BinQueries(
self.name, self.repo).all_package_names_by_repo()
self.special_repos: list = [

View file

@ -29,14 +29,14 @@ class SBoQueries(Configs):
if self.repos.ponce_repo:
self.sbo_table = PonceTable
def count_packages(self):
def count_packages(self) -> int:
""" Counts the number of the packages. """
count = self.session.query(
self.sbo_table.id).count()
return count
def repo_name(self):
def repo_name(self) -> str:
""" Returns the repo name by the table. """
table = inspect(self.sbo_table)
repo = self.repos.sbo_repo_name