Fixed width

This commit is contained in:
Dimitris Zlatanidis 2023-01-03 18:10:53 +02:00
parent fab7d175bd
commit d68a0b002c

View file

@ -53,24 +53,25 @@ class ViewMessage:
def draw_title_box(self, message, title):
""" Drawing title message. """
middle_title = int((self.columns / 2) - len(title) + 2)
print(f'{self.bgreen}' + '' * (self.columns - 2) + '')
print('' + ' ' * int((self.columns / 2) - len(title) + 2) + f'{title}' + ' ' * 36 + f'')
print('' + '' * (self.columns - 2) + f'')
print('' + ' ' * middle_title + f'{title}' + ' ' * (self.columns - middle_title - len(title) - 2) + f'')
self.draw_middle_line()
print(f'{self.endc} {message}' + ' ' * (self.columns - len(message) - 3) + f'{self.bgreen}')
print('' + '' * (self.columns - 2) + f'{self.endc}')
print(f'{self.bgreen}{self.endc} Package:' + ' ' * 27 + 'Version:' + ' ' * 29 + f'Size{self.bgreen}{self.endc}')
self.draw_middle_line()
print(f'{self.bgreen}{self.endc} Package:' + ' ' * 27 + 'Version:' + ' ' * (self.columns - 51) + f'Size{self.bgreen}{self.endc}')
def draw_middle_line(self):
""" Drawing a middle line. """
print(f'{self.bgreen}' + '' * 78 + f'{self.endc}')
print(f'{self.bgreen}' + '' * (self.columns - 2) + f'')
def draw_dependency_line(self):
""" Drawing the dependencies line. """
print(f'{self.bgreen}{self.endc} Dependencies:' + ' ' * 64 + f'{self.bgreen}{self.endc}')
print(f'{self.bgreen}{self.endc} Dependencies:' + ' ' * (self.columns - 16) + f'{self.bgreen}{self.endc}')
def view_packages(self, package, version):
""" Printing the main packages. """
print(f'{self.bgreen}{self.bcyan}{package}{self.endc}' + ' ' * (35 - len(package)) + f'{version}' + ' ' * (42 - len(version)) + f'{self.bgreen}{self.endc}')
print(f'{self.bgreen}{self.bcyan}{package}{self.endc}' + ' ' * (35 - len(package)) + f'{version}' + ' ' * ((self.columns - 37) - len(version) - 1) + f'{self.bgreen}{self.endc}')
def draw_bottom_line(self):
"""" Drawing the bottom line. """