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']
endc = color['endc']
print(end='\rCollecting the data... ')
for package in packages:
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()]))
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'Requires: {green}{deps}{endc}\n'
f'Dependees: {green}{dependees}{endc}\n'
@ -85,16 +86,12 @@ class ViewPackage:
def dependees(self, name):
""" Collecting the dependees. """
if '--dependees' in self.flags:
print(end='\rCollecting the data... ')
sbos = SBoQueries(name).names()
for sbo in sbos:
requires = SBoQueries(sbo).requires()
if name in requires:
version = SBoQueries(sbo).version()
yield f'{sbo} ({version})'
print('\n')
else:
return ''
@staticmethod
def http_request(link):