Updated for options check

This commit is contained in:
Dimitris Zlatanidis 2023-04-08 23:30:44 +03:00
parent 48613cf692
commit 7100e55661

View file

@ -27,9 +27,12 @@ class Tracking(Configs):
self.grey: str = self.color['grey']
self.yellow: str = self.color['yellow']
self.endc: str = self.color['endc']
self.flag_pkg_version: list = ['-p', '--pkg-version']
self.repo_for_binaries: bool = self.utils.is_option(['-B', '--bin-repo='], self.flags)
self.flag_pkg_version: bool = self.utils.is_option(
['-p', '--pkg-version'], self.flags)
self.repo_for_binaries: bool = self.utils.is_option(
['-B', '--bin-repo='], self.flags)
def packages(self, packages: list, repo: str) -> None:
""" Prints the packages dependencies. """
@ -50,7 +53,7 @@ class Tracking(Configs):
for package in packages:
pkg = f'{self.yellow}{package}{self.endc}'
if self.utils.is_option(self.flag_pkg_version, self.flags):
if self.flag_pkg_version:
if self.repo_for_binaries:
version: str = bin_repo_dict[package][0]
@ -75,7 +78,7 @@ class Tracking(Configs):
for i, req in enumerate(requires, start=1):
require: str = f'{self.cyan}{req}{self.endc}'
if self.utils.is_option(self.flag_pkg_version, self.flags):
if self.flag_pkg_version:
if self.repo_for_binaries:
version: str = f" {self.yellow}{bin_repo_dict[req][0]}{self.endc}"