From 05a9cd551e08185ff2846385622b1072010e1dbf Mon Sep 17 00:00:00 2001 From: Arvedui Date: Sun, 6 Sep 2015 14:01:42 +0200 Subject: [PATCH] fix docs code discrepancy and error reporting with non empty format strings --- i3pystatus/shell.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/i3pystatus/shell.py b/i3pystatus/shell.py index 90261fb..b015879 100644 --- a/i3pystatus/shell.py +++ b/i3pystatus/shell.py @@ -24,7 +24,7 @@ class Shell(IntervalModule): ) required = ("command",) - format = "{command}" + format = "{output}" def run(self): retvalue, out, stderr = run_through_shell(self.command, enable_shell=True) @@ -37,9 +37,7 @@ class Shell(IntervalModule): elif stderr: out = stderr - out = self.format.format(command=out) - self.output = { - "full_text": out if out else "Command `%s` returned %d" % (self.command, retvalue), + "full_text": self.format.format(output=out) if out else "Command `%s` returned %d" % (self.command, retvalue), "color": self.color if retvalue == 0 else self.error_color }