From 59f573d0497c9f14c880f192655053c3ad40618f Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 7 Aug 2019 10:43:28 -0300 Subject: [PATCH] suggestions fix --- fpakman/core/controller.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fpakman/core/controller.py b/fpakman/core/controller.py index 1fef4db2..f7f89dea 100755 --- a/fpakman/core/controller.py +++ b/fpakman/core/controller.py @@ -291,15 +291,18 @@ class GenericApplicationManager(ApplicationManager): return warnings - def _fill_suggestions(self, suggestions: list, man: ApplicationManager): + def _fill_suggestions(self, suggestions: list, man: ApplicationManager, limit: int): if self._is_enabled(man): - suggestions.extend(man.list_suggestions(6)) + man_sugs = man.list_suggestions(limit) + + if man_sugs: + suggestions.extend(man_sugs) def list_suggestions(self, limit: int) -> List[Application]: if self.managers: suggestions, threads = [], [] for man in self.managers: - t = Thread(target=self._fill_suggestions, args=(suggestions, man)) + t = Thread(target=self._fill_suggestions, args=(suggestions, man, limit)) t.start() threads.append(t)