[all] Refactor module <-> output communication

Modules now return "bumblebee.output.Widget" objects, so that they can
actually define a list of items to be drawn in the bar.
This commit is contained in:
Tobias Witek 2016-11-05 08:59:43 +01:00
parent 7f91b8298f
commit bab7821607
6 changed files with 223 additions and 131 deletions

View file

@ -31,7 +31,11 @@ class Module(bumblebee.module.Module):
param_name = "{}.format".format(module)
self._fmt = config.parameter(param_name, default)
def data(self):
return datetime.datetime.now().strftime(self._fmt)
def widgets(self):
return [
bumblebee.output.Widget(
datetime.datetime.now().strftime(self._fmt)
)
]
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4