diff --git a/slpkg/dependees.py b/slpkg/dependees.py index b8d5cb36..0be3981d 100644 --- a/slpkg/dependees.py +++ b/slpkg/dependees.py @@ -41,7 +41,7 @@ class Dependees(Configs, Utilities): if self.ponce_repo: self.sbo_table = PonceTable - def slackbuilds(self): + def slackbuilds(self) -> None: """ Collecting the dependees. """ print(f"The list below shows the " f"packages that dependees on '{', '.join([p for p in self.packages])}':\n") diff --git a/slpkg/dialog_box.py b/slpkg/dialog_box.py index fa90c12e..8fb16c22 100644 --- a/slpkg/dialog_box.py +++ b/slpkg/dialog_box.py @@ -4,7 +4,7 @@ import locale from dialog import Dialog from pathlib import Path -from typing import Union +from typing import Union, Tuple from slpkg.configs import Configs from slpkg.views.version import Version @@ -22,7 +22,7 @@ class DialogBox(Configs): self.d.set_background_title(f'{self.prog_name} {Version().version} - Software Package Manager') def checklist(self, text: str, packages: list, title: str, height: int, width: int, - list_height: int, choices: list): + list_height: int, choices: list) -> Tuple[bool, list]: """ Display a checklist box. """ more_kwargs: dict = {} @@ -37,7 +37,7 @@ class DialogBox(Configs): return code, tags - def mixedform(self, text: str, title: str, elements: list, height: int, width: int): + def mixedform(self, text: str, title: str, elements: list, height: int, width: int) -> Tuple[bool, list]: """ Display a mixedform box. """ more_kwargs: dict = {} @@ -54,12 +54,12 @@ class DialogBox(Configs): return code, tags - def msgbox(self, text: str, height: int, width: int): + def msgbox(self, text: str, height: int, width: int) -> None: """ Display a message box. """ if self.dialog: self.d.msgbox(text, height, width) - def textbox(self, text: Union[str, Path], height: int, width: int): + def textbox(self, text: Union[str, Path], height: int, width: int) -> None: """ Display a text box. """ if self.dialog: self.d.textbox(text, height, width) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 9f2a30c5..06eeb4b3 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -22,7 +22,7 @@ class Downloader(Configs): self.flag_parallel: list = ['-P', '--parallel'] - def download(self): + def download(self) -> None: """ Starting the processing for downloading. """ process: list = [] diff --git a/slpkg/form_configs.py b/slpkg/form_configs.py index 648a88da..3b66eb0b 100644 --- a/slpkg/form_configs.py +++ b/slpkg/form_configs.py @@ -21,7 +21,7 @@ class FormConfigs(Configs): self.orig_configs: list = [] self.config_file = Path(self.etc_path, f'{self.prog_name}.toml') - def is_dialog_enabled(self): + def is_dialog_enabled(self) -> None: """ Checking if the dialog box is enabled by the user. """ if not self.dialog: self.utils.raise_error_message(f"You should enable the dialog " diff --git a/slpkg/main.py b/slpkg/main.py index ec39c9f7..f7e8dc95 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -266,7 +266,7 @@ class Argparse(Configs): self.move_options() self.invalid_options() - def invalid_options(self): + def invalid_options(self) -> None: """ Checks for invalid options. """ invalid: list = [] commands: list = [] @@ -295,7 +295,7 @@ class Argparse(Configs): # Fixed for correct options by command. try: - options = self.commands[self.args[0]] + options: list = self.commands[self.args[0]] for opt in self.flags: if opt not in options: invalid.append(opt) @@ -361,9 +361,9 @@ class Argparse(Configs): else: new_args.append(opt) - self.args = new_args + self.args: list = new_args - def is_file_list_packages(self): + def is_file_list_packages(self) -> list: """ Checks if the arg is filelist.pkgs. """ if self.args[1].endswith(self.file_list_suffix): file = Path(self.args[1]) diff --git a/slpkg/remove_packages.py b/slpkg/remove_packages.py index a510fe29..1de2486c 100644 --- a/slpkg/remove_packages.py +++ b/slpkg/remove_packages.py @@ -84,7 +84,7 @@ class RemovePackages(Configs): LogsDependencies.name == pkg).delete() self.session.commit() - def multi_process(self, command: str, package: str): + def multi_process(self, command: str, package: str) -> None: """ Starting multiprocessing remove process. """ if self.silent_mode and not self.utils.is_option(self.flag_no_silent, self.flags): diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index 03bc39bd..9a54b121 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -133,7 +133,7 @@ class Slackbuilds(Configs): self.view_message.question() - def is_not_for_skipped(self, sbo) -> Literal[True]: + def is_not_for_skipped(self, sbo: str) -> Literal[True]: """ Condition to check if slackbuild is for skipped. """ return (not self.utils.is_package_installed(sbo, self.file_pattern) or self.utils.is_package_upgradeable(sbo, self.file_pattern) or diff --git a/slpkg/tracking.py b/slpkg/tracking.py index 58c952b7..c92ff7d4 100644 --- a/slpkg/tracking.py +++ b/slpkg/tracking.py @@ -44,7 +44,7 @@ class Tracking(Configs, Utilities): how_many: int = len(requires) if not requires: - requires = ['No dependencies'] + requires: list = ['No dependencies'] print(pkg) print(char, end='') diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index a9cdd733..63f5f024 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -81,7 +81,7 @@ class UpdateRepository(Configs): data = CreateData() data.install_sbo_table() - def check(self, q) -> None: + def check(self, queue) -> None: check_updates = CheckUpdates() is_update: int = 0 if not check_updates.check(): @@ -91,7 +91,7 @@ class UpdateRepository(Configs): print(f'\n\n{self.bgreen}There are new updates available!{self.endc}') is_update: int = 1 - return q.put(is_update) + return queue.put(is_update) def repository(self) -> None: """ Starting multiprocessing download process. """ diff --git a/slpkg/utilities.py b/slpkg/utilities.py index b0c48dc1..ddf94371 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -169,7 +169,7 @@ class Utilities: with open(file, 'r', encoding='utf-8') as f: return f.readlines() - def process(self, command: str, stderr=None, stdout=None): + def process(self, command: str, stderr=None, stdout=None) -> None: """ Handle the processes. """ try: output = subprocess.call(command, shell=True, stderr=stderr, stdout=stdout) diff --git a/slpkg/views/cli_menu.py b/slpkg/views/cli_menu.py index 94f9ce01..83332401 100644 --- a/slpkg/views/cli_menu.py +++ b/slpkg/views/cli_menu.py @@ -17,9 +17,9 @@ class Usage(Configs): self.yellow: str = color['yellow'] self.endc: str = color['endc'] - def help_minimal(self): + def help_minimal(self) -> NoReturn: """ Prints the minimal help menu. """ - args = ( + args: str = ( f'\nUsage: {self.prog_name} [{self.yellow}OPTIONS{self.endc}] [{self.cyan}COMMAND{self.endc}] ' f'[FILELIST|PACKAGES...]\n' f"\nTry '{self.prog_name} --help' for more options.\n") diff --git a/slpkg/views/views.py b/slpkg/views/views.py index 6fa0fbc8..f13998fe 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -40,7 +40,7 @@ class ViewMessage(Configs): self.file_pattern: str = f'*{self.repo_tag}' self.all_installed: list = list(self.utils.all_installed_names(self.file_pattern)) - def view_packages(self, package, version, mode): + def view_packages(self, package: str, version: str, mode: str) -> None: """ Printing the main packages. """ color: str = self.red