Merge pull request #404 from kockahonza/arch-update_addformat

[modules/arch-update] add format parameter
This commit is contained in:
tobi-wan-kenobi 2019-07-01 20:12:36 +02:00 committed by GitHub
commit 16a308a534
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,11 +29,15 @@ class Module(bumblebee.engine.Module):
return len(packages)
return 0
@property
def _format(self):
return self.parameter("format", "Update Arch: {}")
def utilization(self, widget):
return 'Update Arch: {}'.format(self.packages)
return self._format.format(self.packages)
def hidden(self):
return self.check_updates() == 0
return self.check_updates() == 0
def update(self, widgets):
self.packages = self.check_updates()