From f9132bd7fd9035c7e78958b752ccb1ce2df28e00 Mon Sep 17 00:00:00 2001 From: Bas van den Heuvel Date: Wed, 21 Aug 2019 18:26:59 +0200 Subject: [PATCH] PEP8 --- bumblebee/modules/redshift.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/redshift.py b/bumblebee/modules/redshift.py index 47b9cc4..2ed0b87 100644 --- a/bumblebee/modules/redshift.py +++ b/bumblebee/modules/redshift.py @@ -12,12 +12,14 @@ import bumblebee.input import bumblebee.output import bumblebee.engine + def is_terminated(): for thread in threading.enumerate(): if thread.name == "MainThread" and not thread.is_alive(): return True return False + def get_redshift_value(widget): while True: if is_terminated(): @@ -52,6 +54,7 @@ def get_redshift_value(widget): widget.set("state", "transition") widget.set("transition", " ".join(line.split(" ")[2:])) + class Module(bumblebee.engine.Module): def __init__(self, engine, config): widget = bumblebee.output.Widget(full_text=self.text) @@ -59,7 +62,8 @@ class Module(bumblebee.engine.Module): self._text = "" self._condition = threading.Condition() widget.set("condition", self._condition) - self._thread = threading.Thread(target=get_redshift_value, args=(widget,)) + self._thread = threading.Thread(target=get_redshift_value, + args=(widget,)) self._thread.start() self._condition.acquire() self._condition.notify()