Updated the print method

This commit is contained in:
Dimitris Zlatanidis 2022-12-21 23:45:57 +02:00
parent 25fe8a3949
commit f5ae68d6cc

View file

@ -30,6 +30,7 @@ class ViewPackage:
red = color['red'] red = color['red']
endc = color['endc'] endc = color['endc']
print(end='\rCollecting the data... ')
for package in packages: for package in packages:
dependees = " ".join(list(self.dependees(package))) dependees = " ".join(list(self.dependees(package)))
@ -62,7 +63,7 @@ class ViewPackage:
deps = (', '.join([f'{pkg} ({SBoQueries(pkg).version()})' for pkg in info[2].split()])) deps = (', '.join([f'{pkg} ({SBoQueries(pkg).version()})' for pkg in info[2].split()]))
print(f'Name: {green}{info[0]}{endc}\n' print(f'\n\nName: {green}{info[0]}{endc}\n'
f'Version: {green}{info[1]}{endc}\n' f'Version: {green}{info[1]}{endc}\n'
f'Requires: {green}{deps}{endc}\n' f'Requires: {green}{deps}{endc}\n'
f'Dependees: {green}{dependees}{endc}\n' f'Dependees: {green}{dependees}{endc}\n'
@ -85,16 +86,12 @@ class ViewPackage:
def dependees(self, name): def dependees(self, name):
""" Collecting the dependees. """ """ Collecting the dependees. """
if '--dependees' in self.flags: if '--dependees' in self.flags:
print(end='\rCollecting the data... ')
sbos = SBoQueries(name).names() sbos = SBoQueries(name).names()
for sbo in sbos: for sbo in sbos:
requires = SBoQueries(sbo).requires() requires = SBoQueries(sbo).requires()
if name in requires: if name in requires:
version = SBoQueries(sbo).version() version = SBoQueries(sbo).version()
yield f'{sbo} ({version})' yield f'{sbo} ({version})'
print('\n')
else:
return ''
@staticmethod @staticmethod
def http_request(link): def http_request(link):