From a3daaa1ab85021b040f01c688a4c8cfaefcd10bb Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 7 Dec 2022 17:47:10 +0200 Subject: [PATCH] Fixed code style Signed-off-by: Dimitris Zlatanidis --- slpkg/main.py | 21 +++++++++------------ slpkg/views/view_package.py | 1 + slpkg/views/views.py | 4 ++++ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/slpkg/main.py b/slpkg/main.py index 743d9f96..560dfbcc 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -25,6 +25,15 @@ class Argparse: def __init__(self, args): self.args: list = args + self.usage = Usage() + + if len(self.args) == 0: + self.usage.help_short() + + self.flags = [] + self.check = Check() + self.configs = Configs + self.check.blacklist(self.args) self.options = ['--yes', '--jobs', @@ -32,18 +41,6 @@ class Argparse: '--reinstall', '--skip-installed'] - if len(self.args) == 0: - self.usage.help_short() - - self.flags = [] - self.configs = Configs - self.usage = Usage() - self.flag() - self.check = Check() - - self.check.blacklist(self.args) - - def flag(self): for option in self.options: if option in self.args: self.args.remove(option) diff --git a/slpkg/views/view_package.py b/slpkg/views/view_package.py index 6c0ad5eb..b9b1f2bb 100644 --- a/slpkg/views/view_package.py +++ b/slpkg/views/view_package.py @@ -19,6 +19,7 @@ class ViewPackage: self.colors = self.configs.colour def package(self, packages): + """ View the packages from the repository. """ http = urllib3.PoolManager() color = self.colors() green = color['green'] diff --git a/slpkg/views/views.py b/slpkg/views/views.py index d72402bd..aa32d70b 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -24,6 +24,7 @@ class ViewMessage: self.installed_packages = [] def build_packages(self, slackbuilds: list, dependencies: list): + """ View packages for build only. """ print('The following packages will be build:\n') for sbo in slackbuilds: @@ -39,6 +40,7 @@ class ViewMessage: self._view_total(slackbuilds, dependencies, option='build') def install_packages(self, slackbuilds: list, dependencies: list): + """ View packages for install. """ print('The following packages will be installed or upgraded:\n') for sbo in slackbuilds: @@ -176,6 +178,7 @@ class ViewMessage: f'will be removed.{color["endc"]}') def logs_packages(self, dependencies): + """ View the logging packages. """ print('The following logs will be removed:\n') color = self.colors() @@ -186,6 +189,7 @@ class ViewMessage: print('Note: After cleaning you should remove them one by one.') def question(self): + """ Manage the proceed. """ if '--yes' not in self.flags: answer = input('\nDo you want to continue [y/N]: ') print()