From 57be3c45a974e26689c2abd66be900847f78c810 Mon Sep 17 00:00:00 2001 From: enkore Date: Mon, 1 Feb 2016 13:11:58 +0100 Subject: [PATCH] updates: add an individual formatter for every backend --- i3pystatus/updates/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/i3pystatus/updates/__init__.py b/i3pystatus/updates/__init__.py index 8ed0e07..de45265 100644 --- a/i3pystatus/updates/__init__.py +++ b/i3pystatus/updates/__init__.py @@ -21,6 +21,10 @@ class Updates(Module): .. rubric:: Available formatters * `{count}` — Sum of all available updates from all backends. + * For each backend registered there is one formatter named after the backend, + multiple identical backends do not accumulate, but overwrite each other. + * For example, `{Cower}` (note capitcal C) is the number of updates reported by + the cower backend, assuming it has been registered. .. rubric:: Usage example @@ -95,7 +99,9 @@ class Updates(Module): updates_count = 0 for backend in self.backends: - updates_count += backend.updates + updates = backend.updates + updates_count += updates + self.data[backend.__class__.__name__] = updates if updates_count == 0: self.output = {} if not self.format_no_updates else {