Updated code style

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-02-14 15:56:43 +01:00
parent 5af8876956
commit 99b3f5b456
6 changed files with 5 additions and 11 deletions

View file

@ -53,7 +53,7 @@ def print_logo():
with open(logo_fname, 'rb') as f:
logo = f.read().decode('utf-8')
print(logo)
time.sleep(1)
time.sleep(0.5)
print_logo()

View file

@ -66,7 +66,6 @@ class Updates:
def status_bar(self):
"""Top view bar status
"""
print()
self.msg.template(78)
print("| Repository Status")
self.msg.template(78)

View file

@ -44,7 +44,6 @@ class Config:
def view(self):
"""View slpkg config file
"""
print() # new line at start
conf_args = [
"RELEASE",
"SLACKWARE_VERSION",

View file

@ -53,7 +53,6 @@ class PkgDesc:
def view(self):
"""Print package description by repository
"""
print() # new line at start
description, count = "", 0
if self.repo == "sbo":
description = SBoGrep(self.name).description()
@ -68,7 +67,4 @@ class PkgDesc:
if description:
print(f"{self.color}{description}{self.meta.color['ENDC']}")
else:
self.msg.pkg_not_found("", self.name, "No matching", "\n")
raise SystemExit(1)
if description and self.repo == "sbo":
print()
self.msg.pkg_not_found("", self.name, "No matching", "")

View file

@ -184,10 +184,10 @@ class Patches:
"""
for upg, size in sorted(zip(self.upgrade_all, self.comp_sum)):
pkg_repo = split_package(upg[:-4])
color = self.meta.color["RED"]
color = self.red
pkg_inst = GetFromInstalled(pkg_repo[0]).name()
if pkg_repo[0] == pkg_inst:
color = self.meta.color["YELLOW"]
color = self.yellow
ver = GetFromInstalled(pkg_repo[0]).version()
print(f" {color}{pkg_repo[0] + ver}{self.endc}"
f"{' ' * (23-len(pkg_repo[0] + ver))} {pkg_repo[1]}"

View file

@ -33,7 +33,7 @@ def slackware_repository():
"""
slack_repo, packages, names, name = [], [], [], ""
slack_repo = repo_data(
Utils().read_file(_meta_.lib_path + "slack_repo/PACKAGES.TXT"),
Utils().read_file(f"{_meta_.lib_path}slack_repo/PACKAGES.TXT"),
"slack", "")
for pkg in slack_repo[0]:
name = split_package(pkg)[0]