Updated for package version

This commit is contained in:
Dimitris Zlatanidis 2023-05-09 17:20:14 +03:00
parent bdf71b12df
commit 659c383c95

View file

@ -24,6 +24,7 @@ class Dependees(Configs):
self.llc: str = self.ascii.lower_left_corner self.llc: str = self.ascii.lower_left_corner
self.hl: str = self.ascii.horizontal_line self.hl: str = self.ascii.horizontal_line
self.var: str = self.ascii.vertical_and_right self.var: str = self.ascii.vertical_and_right
self.package_version: str = str()
self.is_binary: bool = self.utils.is_binary_repo(repository) self.is_binary: bool = self.utils.is_binary_repo(repository)
@ -49,19 +50,19 @@ class Dependees(Configs):
self.print_dependees(dependees) self.print_dependees(dependees)
self.summary_of_dependees(dependees, pkg) self.summary_of_dependees(dependees, pkg)
def choose_version(self, name: str) -> str: def set_the_package_version(self, name: str):
if self.is_binary: if self.is_binary:
version: str = self.data[name][0] self.package_version: str = self.data[name][0]
else: else:
version: str = self.data[name][2] self.package_version: str = self.data[name][2]
return version
def print_dependees(self, dependees: dict) -> None: def print_dependees(self, dependees: dict) -> None:
for n, (name, requires) in enumerate(dependees.items(), start=1): for n, (name, requires) in enumerate(dependees.items(), start=1):
dependency: str = f'{self.cyan}{name}{self.endc}' dependency: str = f'{self.cyan}{name}{self.endc}'
if self.option_for_pkg_version: if self.option_for_pkg_version:
self.set_the_package_version(name)
dependency: str = (f'{self.cyan}{name}{self.endc} {self.yellow}' dependency: str = (f'{self.cyan}{name}{self.endc} {self.yellow}'
f'{self.choose_version(name)}{self.endc}') f'{self.package_version}{self.endc}')
self.print_dependency(n, dependency) self.print_dependency(n, dependency)