mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-19 10:27:07 +01:00
Updated for color
This commit is contained in:
parent
fef1edbbc6
commit
8d4166a2aa
1 changed files with 14 additions and 8 deletions
|
@ -62,7 +62,6 @@ class Upgrade(Configs):
|
|||
# if not self.utils.is_package_installed(name):
|
||||
if name not in self.installed_names:
|
||||
yield name
|
||||
|
||||
print(f'{self.bgreen}{self.ascii.done}{self.endc}')
|
||||
|
||||
def is_package_upgradeable(self, installed: str) -> bool:
|
||||
|
@ -100,7 +99,7 @@ class Upgrade(Configs):
|
|||
'repo_build': repo_build,
|
||||
'inst_version': inst_version,
|
||||
'inst_build': inst_build,
|
||||
'repo': self.repository
|
||||
'type': 'upgrade'
|
||||
}
|
||||
|
||||
if self.repository == self.repos.slack_repo_name and self.removed_packages:
|
||||
|
@ -118,7 +117,7 @@ class Upgrade(Configs):
|
|||
'repo_build': repo_build,
|
||||
'inst_version': inst_version,
|
||||
'inst_build': inst_build,
|
||||
'repo': self.repository
|
||||
'type': 'remove'
|
||||
}
|
||||
|
||||
if self.repository == self.repos.slack_repo_name and self.new_packages:
|
||||
|
@ -129,8 +128,8 @@ class Upgrade(Configs):
|
|||
self.sum_added += 1
|
||||
repo_version: str = self.data[name]['version']
|
||||
repo_build: str = self.data[name]['build']
|
||||
inst_version: str = self.utils.split_package(name)['version']
|
||||
inst_build: str = self.utils.split_package(name)['build']
|
||||
inst_version: str = ''
|
||||
inst_build: str = ''
|
||||
|
||||
found_packages[self.id]: dict = {
|
||||
'name': name,
|
||||
|
@ -138,7 +137,7 @@ class Upgrade(Configs):
|
|||
'repo_build': repo_build,
|
||||
'inst_version': inst_version,
|
||||
'inst_build': inst_build,
|
||||
'repo': self.repository
|
||||
'type': 'add'
|
||||
}
|
||||
|
||||
if found_packages:
|
||||
|
@ -153,6 +152,7 @@ class Upgrade(Configs):
|
|||
repo_build: str = data['repo_build']
|
||||
inst_version: str = data['inst_version']
|
||||
inst_build: str = data['inst_build']
|
||||
mode: str = data['type']
|
||||
|
||||
if len(name) > 17:
|
||||
name: str = f'{name[:14]}...'
|
||||
|
@ -161,8 +161,14 @@ class Upgrade(Configs):
|
|||
if len(repo_version) > 15:
|
||||
repo_version: str = f"{repo_version[:11]}..."
|
||||
|
||||
print(f"{name:<18} {inst_version:<15} {inst_build:<6} {repo_version:<15} "
|
||||
f"{repo_build:<5} {data['repo']:>15}")
|
||||
color: str = self.violet
|
||||
if mode == 'remove':
|
||||
color: str = self.red
|
||||
if mode == 'add':
|
||||
color: str = self.cyan
|
||||
|
||||
print(f"{color}{name:<18}{self.endc} {inst_version:<15} {inst_build:<6} {repo_version:<15} "
|
||||
f"{repo_build:<5} {self.repository:>15}")
|
||||
|
||||
print(len(title) * '=')
|
||||
print(f'{self.grey}Packages to upgrade {self.sum_upgrade}, packages to remove '
|
||||
|
|
Loading…
Reference in a new issue