From 117a2acfff78574adc867a14aafe0d3ef1e4ad38 Mon Sep 17 00:00:00 2001 From: Matus Telgarsky Date: Tue, 27 Jan 2015 15:34:05 -0500 Subject: [PATCH] braille graphs: pep8 fixes --- i3pystatus/core/util.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/i3pystatus/core/util.py b/i3pystatus/core/util.py index 8c259ab..0b0a876 100644 --- a/i3pystatus/core/util.py +++ b/i3pystatus/core/util.py @@ -385,17 +385,17 @@ def make_graph(values, upper_limit=100.0, style="blocks"): else: graph = ''.join(bar[int((n - mn) / extent * bar_count)] for n in values) elif style == 'braille': - #idea from https://github.com/asciimoo/drawille - #unicode values from http://en.wikipedia.org/wiki/Braille + # idea from https://github.com/asciimoo/drawille + # unicode values from http://en.wikipedia.org/wiki/Braille v2 = values if len(values) % 2 == 0 else values + [mn] l = len(v2) // 2 if extent == 0: - graph = chr(0x2800) * l #should be visually equiv to ' ' + graph = chr(0x2800) * l # should be visually equiv to ' ' else: graph = '' for i in range(0, l, 2): - b1 = [ 0, 0x40, 0x44, 0x46, 0x47 ][ round(4 * (v2[i] - mn) / extent) ] - b2 = [ 0, 0x80, 0xa0, 0xb0, 0xb8 ][ round(4 * (v2[i + 1] - mn) / extent) ] + b1 = [0, 0x40, 0x44, 0x46, 0x47][round(4 * (v2[i] - mn) / extent)] + b2 = [0, 0x80, 0xa0, 0xb0, 0xb8][round(4 * (v2[i + 1] - mn) / extent)] graph += chr(0x2800 + b1 + b2) else: raise NotImplementedError("Graph drawing style '%s' unimplemented." % style)