Updated for doubles deps

This commit is contained in:
Dimitris Zlatanidis 2023-05-11 09:26:09 +03:00
parent 5d74ed0403
commit eae94cdcc4

View file

@ -34,6 +34,7 @@ class RemovePackages(Configs):
self.logs_dependencies: dict = {}
self.process_message: str = str()
self.installed_packages: list = []
self.installed_dependencies: list = []
self.dependencies: list = []
self.stderr = None
self.stdout = None
@ -50,6 +51,8 @@ class RemovePackages(Configs):
def remove(self) -> None:
self.query_logs_dependencies()
self.save_dependencies_for_remove()
self.remove_doubles_dependencies()
self.add_dependencies_to_remove()
self.choose_dependencies_for_remove()
self.save_packages_for_remove()
@ -71,7 +74,14 @@ class RemovePackages(Configs):
installed: str = self.utils.is_package_installed(require)
if installed and require not in self.packages:
self.dependencies.append(require)
self.installed_packages.append(installed)
self.installed_dependencies.append(installed)
def remove_doubles_dependencies(self):
self.dependencies: list = list(set(self.dependencies))
self.installed_dependencies: list = list(set(self.installed_dependencies))
def add_dependencies_to_remove(self):
self.installed_packages.extend(self.installed_dependencies)
def save_packages_for_remove(self):
for package in self.packages: