From 1d4403e3081c569c7f0f5cd63b94662b73b1f4cf Mon Sep 17 00:00:00 2001 From: enkore Date: Mon, 18 Feb 2013 18:00:16 +0100 Subject: [PATCH] Let's remove that synchronous functionality alltogether. It simply isn't in the spirit of this app :-) And nobody uses it. --- i3pystatus/__init__.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/i3pystatus/__init__.py b/i3pystatus/__init__.py index 6d6f9fa..1f8d19d 100644 --- a/i3pystatus/__init__.py +++ b/i3pystatus/__init__.py @@ -7,19 +7,13 @@ from threading import Thread import time from contextlib import contextmanager -class BaseModule: +class Module: output = None def registered(self, status_handler): """Called when this module is registered with a status handler""" - def tick(self): - """Called once per tick""" - -class Module(BaseModule): - pass - -class AsyncModule(BaseModule): +class AsyncModule(Module): def registered(self, status_handler): self.thread = Thread(target=self.mainloop) self.thread.daemon = True @@ -80,7 +74,6 @@ class JSONIO: j = json.loads(line) yield j - self.io.write(prefix + json.dumps(j)) class I3statusHandler: @@ -104,8 +97,6 @@ class I3statusHandler: while True: with jio.read() as j: for module in self.modules: - module.tick() - output = module.output if output: j.insert(0, output)