From 99b3f5b45696fc5f13acc7324b4d37cebb4bf3f6 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 14 Feb 2020 15:56:43 +0100 Subject: [PATCH] Updated code style Signed-off-by: Dimitris Zlatanidis --- setup.py | 2 +- slpkg/checks.py | 1 - slpkg/config.py | 1 - slpkg/desc.py | 6 +----- slpkg/slack/patches.py | 4 ++-- slpkg/slack/slackware_repo.py | 2 +- 6 files changed, 5 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index ef4cce17..5c544616 100755 --- a/setup.py +++ b/setup.py @@ -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() diff --git a/slpkg/checks.py b/slpkg/checks.py index 1c0fab67..26f79bed 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -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) diff --git a/slpkg/config.py b/slpkg/config.py index 09b953d7..9cac90d7 100644 --- a/slpkg/config.py +++ b/slpkg/config.py @@ -44,7 +44,6 @@ class Config: def view(self): """View slpkg config file """ - print() # new line at start conf_args = [ "RELEASE", "SLACKWARE_VERSION", diff --git a/slpkg/desc.py b/slpkg/desc.py index 42823a42..00267752 100644 --- a/slpkg/desc.py +++ b/slpkg/desc.py @@ -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", "") \ No newline at end of file diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index fe3d959d..6b145bb3 100644 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -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]}" diff --git a/slpkg/slack/slackware_repo.py b/slpkg/slack/slackware_repo.py index d1e1a4ce..5a177d09 100644 --- a/slpkg/slack/slackware_repo.py +++ b/slpkg/slack/slackware_repo.py @@ -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]