Skip to content

Commit

Permalink
fixed tox reported formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oaken-source committed Mar 1, 2022
1 parent 14fa281 commit 95e1bb6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions py3status/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 95e1bb6

Please sign in to comment.