From fb6bc9cd6d9bf20b22c9311a882dc3595c481161 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 21 Mar 2023 22:41:55 +0200 Subject: [PATCH] Updated for options --- slpkg/main.py | 6 +++--- slpkg/update_repository.py | 10 +++++----- slpkg/views/cli_menu.py | 6 ++++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/slpkg/main.py b/slpkg/main.py index 948dd0e7..0e0f5608 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -85,7 +85,7 @@ class Argparse(Configs): self.flag_short_parallel: str = '-P' self.flag_binary: str = '--binary' self.flag_short_binary: str = '-B' - self.flag_bin_repository: str = '--repo=' + self.flag_bin_repository: str = '--repository=' self.flag_short_bin_repository: str = '-O=' self.flag_directory: str = '--directory=' self.flag_short_directory: str = '-z=' @@ -477,7 +477,7 @@ class Argparse(Configs): def update(self) -> None: if len(self.args) == 1: update = UpdateRepository(self.flags, self.binary_repo) - update.repository() + update.repositories() raise SystemExit() self.usage.help_short(1) @@ -543,7 +543,7 @@ class Argparse(Configs): def clean_data(self) -> None: if len(self.args) == 1: - update = UpdateRepository(self.flags) + update = UpdateRepository(self.flags, self.binary_repo) update.drop_the_tables() raise SystemExit() self.usage.help_short(1) diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index ccc037f0..f5d30877 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -21,10 +21,10 @@ from slpkg.models.models import (Base, engine, SBoTable, class UpdateRepository(Configs): """ Deletes and install the data. """ - def __init__(self, flags: list, repo: str): + def __init__(self, flags: list, repository: str): super(Configs, self).__init__() self.flags: list = flags - self.repo: str = repo + self.repository: str = repository self.session = Session self.view = ViewMessage(self.flags) @@ -59,7 +59,7 @@ class UpdateRepository(Configs): def binary_repositories(self): """ Update the binary repositories. """ - if self.repos.gnome_repo and self.repo == self.repos.gnome_repo_name or self.repo == '*': + if self.repos.gnome_repo and self.repository == self.repos.gnome_repo_name or self.repository == '*': urls: list = [] print('Updating the packages list...\n') print(f"Downloading the '{self.green}{self.repos.gnome_repo_name}{self.endc}' repository, please wait...\n") @@ -79,7 +79,7 @@ class UpdateRepository(Configs): self.data.install_gnome_data() print() - if self.repos.conraid_repo and self.repo == self.repos.conraid_repo_name or self.repo == '*': + if self.repos.conraid_repo and self.repository == self.repos.conraid_repo_name or self.repository == '*': urls: list = [] print('Updating the packages list...\n') print(f"Downloading the '{self.green}{self.repos.conraid_repo_name}{self.endc}' " @@ -162,7 +162,7 @@ class UpdateRepository(Configs): return queue.put(is_update) - def repository(self) -> None: + def repositories(self) -> None: """ Starting multiprocessing download process. """ queue = Queue() message = f'Checking for news, please wait...' diff --git a/slpkg/views/cli_menu.py b/slpkg/views/cli_menu.py index 83332401..9e63b792 100644 --- a/slpkg/views/cli_menu.py +++ b/slpkg/views/cli_menu.py @@ -40,8 +40,8 @@ class Usage(Configs): f' slpkg [{self.yellow}OPTIONS{self.endc}] [-y, --yes, -j, --jobs, -o, --resolve-off, -r, --reinstall]\n' f' slpkg [{self.yellow}OPTIONS{self.endc}] [-k, --skip-installed, -E, --full-reverse, -S, --search]\n' f' slpkg [{self.yellow}OPTIONS{self.endc}] [-n, --no-silent, -p, --pkg-version, -G, --generate-only]\n' - f' slpkg [{self.yellow}OPTIONS{self.endc}] [-P, --parallel, -z, --directory=[PATH]]\n' - f' slpkg [{self.yellow}OPTIONS{self.endc}] [-F, --file-pattern=[PATTERN]]\n' + f' slpkg [{self.yellow}OPTIONS{self.endc}] [-P, --parallel, -B, --binary, -O, --repository=[REPO]]\n' + f' slpkg [{self.yellow}OPTIONS{self.endc}] [-z, --directory=[PATH], -F, --file-pattern=[PATTERN]]\n' " \nIf you need more information please try 'slpkg --help'.") print(args) @@ -82,6 +82,8 @@ class Usage(Configs): f' {self.yellow}-p, --pkg-version{self.endc} Print the repository package version.\n' f' {self.yellow}-G, --generate-only{self.endc} Generates only the SLACKBUILDS.TXT file.\n' f' {self.yellow}-P, --parallel{self.endc} Download files in parallel.\n' + f' {self.yellow}-B, --binary{self.endc} Switch with binaries repositories.\n' + f' {self.yellow}-O, --repository={self.endc}[REPO] Set the binary repository.\n' f' {self.yellow}-z, --directory={self.endc}[PATH] Download files to a specific path.\n' f' {self.yellow}-F, --file-pattern={self.endc}[PATTERN] Include specific installed files.\n' '\n -h, --help Show this message and exit.\n'