[core/output] Minor refactoring - widget assembly
This commit is contained in:
parent
4e2a645bd3
commit
b157aa9fb5
1 changed files with 11 additions and 7 deletions
|
@ -31,16 +31,20 @@ class i3(object):
|
||||||
def stop(self):
|
def stop(self):
|
||||||
return { 'suffix': '\n]' }
|
return { 'suffix': '\n]' }
|
||||||
|
|
||||||
|
def widgets(self, module):
|
||||||
|
widgets = []
|
||||||
|
for widget in module.widgets():
|
||||||
|
widgets.append({
|
||||||
|
'full_text': widget.full_text(),
|
||||||
|
'instance': widget.id(),
|
||||||
|
'name': module.id(),
|
||||||
|
})
|
||||||
|
return widgets
|
||||||
|
|
||||||
def update(self, affected_modules=None):
|
def update(self, affected_modules=None):
|
||||||
for module in self._modules:
|
for module in self._modules:
|
||||||
module.update()
|
module.update()
|
||||||
self._status[module] = []
|
self._status[module] = self.widgets(module)
|
||||||
for widget in module.widgets():
|
|
||||||
self._status[module].append({
|
|
||||||
'full_text': widget.full_text(),
|
|
||||||
'instance': widget.id(),
|
|
||||||
'name': module.id(),
|
|
||||||
})
|
|
||||||
|
|
||||||
def statusline(self):
|
def statusline(self):
|
||||||
widgets = []
|
widgets = []
|
||||||
|
|
Loading…
Reference in a new issue