[core] Use core.event to decouple main and output
Make output act on events, not on concrete calls.
This commit is contained in:
parent
c1df1686c1
commit
a4904d998f
2 changed files with 9 additions and 4 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue