Fixed D400,D401,D202,D205,D209

This commit is contained in:
Dimitris Zlatanidis 2024-05-22 16:45:42 +03:00
parent 5086d950db
commit 3a87210463

View file

@ -16,8 +16,7 @@ from slpkg.multi_process import MultiProcess
class RemovePackages(Configs): # pylint: disable=[R0902]
"""Removes installed packages with dependencies if they
installed with slpkg install command."""
"""Remove installed packages with dependencies."""
def __init__(self, packages: list, flags: list):
super(Configs, self).__init__()
@ -40,7 +39,7 @@ class RemovePackages(Configs): # pylint: disable=[R0902]
('-O', '--resolve-off'), flags)
def remove(self, upgrade: bool = False) -> None:
"""Remove packages
"""Remove packages.
Args:
upgrade (bool, optional): Is packages comes from upgrade method.
@ -104,11 +103,11 @@ class RemovePackages(Configs): # pylint: disable=[R0902]
print(f"{'':>2}{pkg} {self.grey}{ver}{self.endc}")
def remove_doubles_dependencies(self) -> None:
"""Removes doubles packages."""
"""Remove doubles packages."""
self.dependencies: list = list(set(self.dependencies))
def add_installed_dependencies_to_remove(self) -> None:
"""Adds dependencies for remove."""
"""Add dependencies for remove."""
for dep in self.dependencies:
installed: str = self.utils.is_package_installed(dep)
if installed:
@ -116,7 +115,6 @@ class RemovePackages(Configs): # pylint: disable=[R0902]
def remove_packages(self) -> None:
"""Remove packages."""
# Remove old slpkg.log file.
if self.slpkg_log_file.is_file():
self.slpkg_log_file.unlink()