Fixed for method names

This commit is contained in:
Dimitris Zlatanidis 2023-05-11 21:48:10 +03:00
parent 121d8f39c1
commit 6a9de4c917

View file

@ -31,12 +31,12 @@ class RepoInfo(Configs):
def info(self):
""" Prints information about repositories. """
self.print_the_title()
self.view_the_title()
if self.option_for_repository:
self.print_the_repository_information()
self.view_the_repository_information()
else:
self.print_the_repositories_information()
self.view_the_repositories_information()
def count_the_packages(self, repository: str) -> int:
sbo_table: dict = {
@ -63,7 +63,7 @@ class RepoInfo(Configs):
return date[0]
def print_the_title(self):
def view_the_title(self):
title: str = f'repositories information:'.title()
if self.option_for_repository:
title: str = f'repository information:'.title()
@ -72,7 +72,7 @@ class RepoInfo(Configs):
print(f"{'Name:':<18}{'Status:':<15}{'Last Updated:':<35}{'Packages:':>12}")
print('=' * self.columns)
def print_the_repository_information(self):
def view_the_repository_information(self):
count: int = 0
color: str = self.red
status: str = 'Disabled'
@ -83,10 +83,10 @@ class RepoInfo(Configs):
color: str = self.green
count: int = self.count_the_packages(self.repository)
self.print_the_line_information(self.repository, status, date, count, color)
self.print_summary_of_repository()
self.view_the_line_information(self.repository, status, date, count, color)
self.view_summary_of_repository()
def print_the_repositories_information(self):
def view_the_repositories_information(self):
for repo, item in self.repos.repositories.items():
count: int = 0
color: str = self.red
@ -99,18 +99,18 @@ class RepoInfo(Configs):
color: str = self.green
count: int = self.count_the_packages(repo)
self.print_the_line_information(repo, status, date, count, color)
self.print_summary_of_all_repositories()
self.view_the_line_information(repo, status, date, count, color)
self.view_summary_of_all_repositories()
def print_the_line_information(self, repository: str, status: str, date: str, count: int, color: str):
def view_the_line_information(self, repository: str, status: str, date: str, count: int, color: str):
print(f"{self.cyan}{repository:<18}{self.endc}{color}{status:<15}{self.endc}{date:<35}"
f"{self.yellow}{count:>12}{self.endc}")
def print_summary_of_repository(self):
def view_summary_of_repository(self):
print('=' * self.columns)
print(f"{self.grey}Total {self.total_packages} packages available from the '{self.repository}' repository.\n")
def print_summary_of_all_repositories(self):
def view_summary_of_all_repositories(self):
print('=' * self.columns)
print(f"{self.grey}Total of {self.enabled}/{len(self.repos.repositories)} "
f"repositories are enabled with {self.total_packages} packages available.\n")