[all] Major refactoring

Introduce an "Engine" class to abstract some of the details of loading
modules, registering events, etc.
This commit is contained in:
Tobias Witek 2016-11-04 21:03:12 +01:00
parent a6bdd0557c
commit d62258c89d
5 changed files with 135 additions and 116 deletions

View file

@ -27,9 +27,9 @@ def read_input(output):
subprocess.Popen(shlex.split(cb), stdout=DEVNULL, stderr=DEVNULL)
output.redraw()
class i3bar(bumblebee.output.Output):
def __init__(self, refresh, theme):
super(i3bar, self).__init__(refresh, theme)
class Output(bumblebee.output.Output):
def __init__(self, args):
super(Output, self).__init__(args)
self._data = []
self.add_callback("i3-msg workspace prev_on_output", 4)
@ -41,8 +41,7 @@ class i3bar(bumblebee.output.Output):
def start(self):
return json.dumps({ "version": 1, "click_events": True }) + "["
def add(self, obj):
theme = self.theme()
def add(self, obj, theme):
while True:
d = obj.data()