[core] Use core.event to decouple main and output

Make output act on events, not on concrete calls.
This commit is contained in:
Tobias Witek 2020-02-16 14:30:45 +01:00
parent c1df1686c1
commit a4904d998f
2 changed files with 9 additions and 4 deletions

View file

@ -3,12 +3,16 @@ import json
import time
import core.theme
import core.event
class i3(object):
def __init__(self, theme=core.theme.Theme()):
self._modules = []
self._status = {}
self._theme = theme
core.event.register('start', self.draw, 'start')
core.event.register('update', self.draw, 'statusline')
core.event.register('stop', self.draw, 'stop')
def modules(self, modules=None):
if not modules: