Updated for choose for upgrade

This commit is contained in:
Dimitris Zlatanidis 2024-04-04 10:42:22 +03:00
parent 88e118f08f
commit e81ec798ee

View file

@ -62,20 +62,26 @@ class Choose(Configs):
def choose_for_upgraded(self, data: dict, packages: list):
""" Choose packages that they will going to upgrade. """
for pkg in packages:
for package in data.keys():
for package in packages:
# for package in data.keys():
if pkg == package:
inst_package: str = self.utils.is_package_installed(package)
inst_package_version: str = self.utils.split_package(inst_package)['version']
inst_package_build: str = self.utils.split_package(inst_package)['build']
repo_ver: str = data[package]['version']
repo_build_tag: str = data[package]['build']
if package in data.keys():
inst_package: str = self.utils.is_package_installed(package)
inst_package_version: str = self.utils.split_package(inst_package)['version']
inst_package_build: str = self.utils.split_package(inst_package)['build']
self.choices.extend(
[(package, f'{inst_package_version} -> {repo_ver}', True,
f'Installed: {package}-{inst_package_version} Build: {inst_package_build} -> '
f'Available: {repo_ver} Build: {repo_build_tag}')])
if not inst_package_version:
inst_package_version: str = 'None'
if not inst_package_build:
inst_package_build: str = 'None'
repo_ver: str = data[package]['version']
repo_build_tag: str = data[package]['build']
self.choices.extend(
[(package, f'{inst_package_version} -> {repo_ver}', True,
f'Installed: {package}-{inst_package_version} Build: {inst_package_build} -> '
f'Available: {repo_ver} Build: {repo_build_tag}')])
def choose_for_others(self, data: dict, packages: list):
""" Choose packages for others methods like install, tracking etc. """