[arch] improvement -> repositories/AUR search time

This commit is contained in:
Vinicius Moreira
2021-01-11 16:33:13 -03:00
parent ce1c08458e
commit 6aebaf6718
5 changed files with 103 additions and 82 deletions

View File

@@ -28,6 +28,17 @@ class SearchResult:
self.new = new
self.total = total
def update_total(self):
total = 0
if self.installed:
total += len(self.installed)
if self.new:
total += len(self.new)
self.total = total
@classmethod
def empty(cls):
return cls(installed=[], new=[], total=0)