[flatpak] suggestions downloaded from bauh-files

This commit is contained in:
Vinícius Moreira
2019-12-20 19:12:45 -03:00
parent 8259c3cede
commit 7681c6abf6
4 changed files with 33 additions and 39 deletions

View File

@@ -253,15 +253,14 @@ class SnapManager(SoftwareManager):
for l in file.text.split('\n'):
if l:
lsplit = l.strip().split('=')
if limit <= 0 or len(suggestions) < limit:
cached_sug = self.suggestions_cache.get(lsplit[1])
sug = l.strip().split('=')
cached_sug = self.suggestions_cache.get(sug[1])
if cached_sug:
res.append(cached_sug)
else:
t = Thread(target=self._fill_suggestion, args=(lsplit[1], SuggestionPriority(int(lsplit[0])), res))
t = Thread(target=self._fill_suggestion, args=(sug[1], SuggestionPriority(int(sug[0])), res))
t.start()
threads.append(t)
time.sleep(0.001) # to avoid being blocked