From eb48bbb38953ea82b9ddf0d553fadd3114e978bb Mon Sep 17 00:00:00 2001 From: Ultrabug Date: Sun, 1 Dec 2013 20:24:56 +0100 Subject: fix first event opening line wrt issue #19 thx to @lathan --- py3status/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py3status/__init__.py b/py3status/__init__.py index d454ab3..bd8072a 100755 --- a/py3status/__init__.py +++ b/py3status/__init__.py @@ -59,6 +59,9 @@ class IOPoller: poll_result = self.poller.poll(timeout) if poll_result: line = self.io.readline().strip() + if self.io == sys.stdin and line == '[': + # skip first event line wrt issue #19 + line = self.io.readline().strip() try: # python3 compatibility code line = line.decode() @@ -263,7 +266,7 @@ class Events(Thread): """ while self.lock.is_set(): event = self.poller_inp.readline() - if not event or event == '[': + if not event: sleep(0.20) continue try: -- cgit v1.3