From f42605e4b0bf20f64f9f3c03502c83d2dcb53d8b Mon Sep 17 00:00:00 2001 From: Andreas Grapentin Date: Tue, 1 Mar 2022 17:44:57 +0100 Subject: [PATCH] fixed tox reported formatting issues --- py3status/core.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/py3status/core.py b/py3status/core.py index 47e2e18ded..dbdd2d9f0b 100644 --- a/py3status/core.py +++ b/py3status/core.py @@ -971,17 +971,16 @@ def process_module_output(self, module): if "color" not in output: output["color"] = color # Create the tmux string output. - if self.config["py3_config"]["general"].get("output_format") == 'tmux': + if self.config["py3_config"]["general"].get("output_format") == "tmux": for output in outputs: - if 'color' in output: - output['full_text'] = f"#[fg={output['color'].lower()}]{output['full_text']}#[default]" - return "".join(x['full_text'] for x in outputs) + if "color" in output: + tmux_full_text = f"#[fg={output['color'].lower()}]{output['full_text']}#[default]" + output["full_text"] = tmux_full_text + return "".join(x["full_text"] for x in outputs) # Create the json string output. else: return ",".join(dumps(x) for x in outputs) - - def i3bar_stop(self, signum, frame): if time.time() - self.i3bar_inhibit_stp > 1: self.log(f"received stop_signal {Signals(signum).name}") @@ -1050,7 +1049,7 @@ def run(self): "click_events": self.config["click_events"], "stop_signal": self.stop_signal or 0, } - if self.config["py3_config"]["general"].get("output_format") != 'tmux': + if self.config["py3_config"]["general"].get("output_format") != "tmux": write(dumps(header)) write("\n[[]\n") @@ -1081,7 +1080,7 @@ def run(self): # build output string and dump to stdout out = "" - if self.config["py3_config"]["general"].get("output_format") == 'tmux': + if self.config["py3_config"]["general"].get("output_format") == "tmux": out = "#[fg=brightblack]|#[default]".join(x for x in output if x) write(f"{out}\n") else: