this isn't the cleanest solution, but its potentially the least breaky (#717)

* this isn't the cleanest solution, but its potentially the least breaky
This commit is contained in:
chestm007 2019-03-14 23:41:55 +11:00 committed by GitHub
parent 2437439d1d
commit 3e219fc64b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -441,8 +441,6 @@ class Network(IntervalModule, ColorRangeModule):
per_sent = network_usage["bytes_sent"] / self.sent_limit
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"] = color_template.format(c_recv, network_usage["bytes_recv"])
format_values["bytes_sent"] = color_template.format(c_sent, network_usage["bytes_sent"])
format_values['network_graph_recv'] = color_template.format(c_recv, format_values["network_graph_recv"])
format_values['network_graph_sent'] = color_template.format(c_sent, format_values["network_graph_sent"])
else:
@ -484,6 +482,9 @@ class Network(IntervalModule, ColorRangeModule):
else:
format_values[metric] = '{:.{round}f}'.format(format_values[metric] / self.divisor,
round=self.round_size)
if self.dynamic_color and self.separate_color and self.pango_enabled:
format_values["bytes_recv"] = color_template.format(c_recv, format_values["bytes_recv"])
format_values["bytes_sent"] = color_template.format(c_sent, format_values["bytes_sent"])
self.data = format_values
self.output = {