diff --git a/i3pystatus/network.py b/i3pystatus/network.py
index 3d066b6..5d7a8f4 100644
--- a/i3pystatus/network.py
+++ b/i3pystatus/network.py
@@ -390,22 +390,19 @@ class Network(IntervalModule, ColorRangeModule):
if self.separate_color and self.pango_enabled:
color = self.color_up
+ color_template = "{}"
per_recv = network_usage["bytes_recv"] * self.divisor / (self.recv_limit * 1024)
per_sent = network_usage["bytes_sent"] * self.divisor / (self.sent_limit * 1024)
c_recv = self.get_gradient(int(per_recv * 100), self.colors, 100)
c_sent = self.get_gradient(int(per_sent * 100), self.colors, 100)
- format_values["bytes_recv"] = "" + \
- str(network_usage["bytes_recv"]) + ""
- format_values["bytes_sent"] = "" + \
- str(network_usage["bytes_sent"]) + ""
+ format_values["bytes_recv"] = color_template.format(c_recv, network_usage["bytes_recv"])
+ format_values["bytes_recv"] = color_template.format(c_sent, network_usage["bytes_sent"])
if self.graph_type == 'output':
c_kbs = c_sent
else:
c_kbs = c_recv
- format_values['network_graph'] = "" + \
- str(format_values["network_graph"]) + ""
- format_values['kbs'] = "" + \
- str(format_values["kbs"]) + ""
+ format_values['network_graph'] = color_template.format(c_kbs, format_values["network_graph"])
+ format_values['kbs'] = color_template.format(c_kbs, format_values["kbs"])
else:
percent = int(kbs * 100 / limit)
color = self.get_gradient(percent, self.colors, 100)
diff --git a/i3pystatus/scratchpad.py b/i3pystatus/scratchpad.py
index d3ab849..f6e4d9b 100644
--- a/i3pystatus/scratchpad.py
+++ b/i3pystatus/scratchpad.py
@@ -41,7 +41,7 @@ class Scratchpad(Module):
t.daemon = True
t.start()
- def update_scratchpad_counter(self, conn, e=None):
+ def update_scratchpad_counter(self, conn, *args):
cons = conn.get_tree().scratchpad().leaves()
self.urgent = any(con for con in cons if con.urgent)
self.count = len(cons)