Updated for typing

This commit is contained in:
Dimitris Zlatanidis 2023-05-11 17:04:37 +03:00
parent 396292595c
commit cfafa18804

View file

@ -42,7 +42,7 @@ class ViewMessage(Configs):
['-y', '--yes'], flags)
def build_packages(self, slackbuilds: list, dependencies: list) -> None:
mode = 'build'
mode: str = 'build'
self.ascii.draw_package_title_box('The following packages will be build:', 'slpkg build packages')
for slackbuild in slackbuilds:
@ -76,7 +76,7 @@ class ViewMessage(Configs):
self.summary(packages, dependencies, option=mode)
def download_packages(self, packages: list, directory: Path) -> None:
mode = 'download'
mode: str = 'download'
self.download_only: Path = directory
self.ascii.draw_package_title_box('The following packages will be downloaded:',
'slpkg download packages')
@ -87,7 +87,7 @@ class ViewMessage(Configs):
self.summary(packages, dependencies=[], option=mode)
def remove_packages(self, packages: list, dependencies: list) -> Any:
mode = 'remove'
mode: str = 'remove'
self.ascii.draw_package_title_box('The following packages will be removed:',
'slpkg remove packages')
for package in packages:
@ -154,11 +154,11 @@ class ViewMessage(Configs):
self.ascii.draw_view_package(package, version, size, color, self.repository)
def view_remove_package(self, package: str) -> None:
installed = self.utils.is_package_installed(package)
installed: str = self.utils.is_package_installed(package)
version: str = self.utils.split_package(installed)['version']
repo_tag: str = self.utils.split_package(installed)['tag']
size: str = self.utils.get_file_size(Path(self.log_packages, installed))
repository = repo_tag.lower().replace('_', '')
repository: str = repo_tag.lower().replace('_', '')
self.ascii.draw_view_package(package, version, size, self.red, repository)
@ -173,7 +173,7 @@ class ViewMessage(Configs):
def summary(self, packages: list, dependencies: list, option: str) -> None:
packages.extend(dependencies)
summary_message: str = str()
install = upgrade = remove = size_comp = size_uncomp = size_rmv = 0
install = upgrade = remove = size_comp = size_uncomp = size_rmv = int()
for pkg in packages:
installed: str = self.utils.is_package_installed(pkg)