Updated for f string

This commit is contained in:
Dimitris Zlatanidis 2023-05-12 13:39:44 +03:00
parent 7afbacc7e5
commit 0868257e7c

View file

@ -45,14 +45,13 @@ class Ascii(Configs):
self.vertical_and_left: str = ''
def draw_package_title_box(self, message: str, title: str) -> None:
""" Drawing package title box. """
title = title.title()
print(f'{self.bgreen}{self.upper_left_corner}' + f'{self.horizontal_line}' * (self.columns - 2) +
f'{self.upper_right_corner}')
print(f'{self.vertical_line}{title.center(self.columns - 2, " ")}{self.vertical_line}')
print(f"{self.bgreen}{self.upper_left_corner}{self.horizontal_line * (self.columns - 2)}"
f"{self.upper_right_corner}")
print(f"{self.vertical_line}{title.center(self.columns - 2, ' ')}{self.vertical_line}")
self.draw_middle_line()
print(f'{self.vertical_line} {self.endc}{message.ljust(self.columns - 3, " ")}'
f'{self.bgreen}{self.vertical_line}')
print(f"{self.vertical_line} {self.endc}{message.ljust(self.columns - 3, ' ')}"
f"{self.bgreen}{self.vertical_line}")
self.draw_middle_line()
print(f"{self.bgreen}{self.vertical_line}{self.endc} {'Package:':<{self.package_alignment}}"
@ -72,22 +71,21 @@ class Ascii(Configs):
def draw_log_package(self, package: str) -> None:
""" Drawing and print logs packages. """
print(f' {self.lower_left_corner}{self.horizontal_line}{self.cyan} {package}{self.endc}\n')
print(f"{'':>2}{self.lower_left_corner}{self.horizontal_line}{self.cyan} {package}{self.endc}\n")
def draw_middle_line(self) -> None:
""" Drawing a middle line. """
print(f'{self.bgreen}{self.vertical_and_right}' + f'{self.horizontal_line}' *
(self.columns - 2) + f'{self.vertical_and_left}')
print(f"{self.bgreen}{self.vertical_and_right}{self.horizontal_line * (self.columns - 2)}"
f"{self.vertical_and_left}")
def draw_dependency_line(self) -> None:
""" Drawing the dependencies line. """
print(f'{self.bgreen}{self.vertical_line}{self.endc} Dependencies:' + ' ' * (self.columns - 16) +
f'{self.bgreen}{self.vertical_line}{self.endc}')
print(f"{self.bgreen}{self.vertical_line}{self.endc} Dependencies:{' ' * (self.columns - 16)}"
f"{self.bgreen}{self.vertical_line}{self.endc}")
def draw_bottom_line(self) -> None:
""" Drawing the bottom line. """
print(f'{self.bold}{self.green}{self.lower_left_corner}' + f'{self.horizontal_line}' *
(self.columns - 2) + f'{self.lower_right_corner}{self.endc}')
print(f"{self.bold}{self.green}{self.lower_left_corner}{self.horizontal_line * (self.columns - 2)}"
f"{self.lower_right_corner}{self.endc}")
def draw_checksum_error_box(self, name: str, checksum: str, file_check: str) -> None:
""" Drawing checksum error box. """