Skip to content

Commit cee32f8

Browse files
More pylint soothing
1 parent 193720e commit cee32f8

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

adafruit_circuitpython_fancyled.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
__repo__ = "https://github.com/Adafruit/Adafruit_CircuitPython_FancyLED.git"
3535

3636

37+
# Function names are kept the same as FastLED, which normally upsets pylint.
38+
# Disable name-checking so this passes muster.
39+
# pylint: disable=invalid-name
40+
3741
"""
3842
FancyLED is sort of a mild CircuitPython interpretation of a subset
3943
of the FastLED library for Arduino. This is mainly to assist with
@@ -84,13 +88,13 @@ def applyGamma_video(n, g_r=GFACTOR, g_g=None, g_b=None, inplace=False):
8488
# fall back on the RGB tuple case.
8589
try:
8690
if inplace:
87-
for i in range(len(n)):
91+
for i in enumerate(n):
8892
n[i] = applyGamma_video(n[i], g_r, g_g, g_b)
89-
else:
90-
newlist = []
91-
for i in n:
92-
newlist += applyGamma_video(i, g_r, g_g, g_b)
93-
return newlist
93+
return None
94+
newlist = []
95+
for i in n:
96+
newlist += applyGamma_video(i, g_r, g_g, g_b)
97+
return newlist
9498
except TypeError:
9599
if g_g is None:
96100
g_g = g_r
@@ -100,10 +104,10 @@ def applyGamma_video(n, g_r=GFACTOR, g_g=None, g_b=None, inplace=False):
100104
n[0] = applyGamma_video(n[0], g_r)
101105
n[1] = applyGamma_video(n[1], g_g)
102106
n[2] = applyGamma_video(n[2], g_b)
103-
else:
104-
return [applyGamma_video(n[0], g_r),
105-
applyGamma_video(n[1], g_g),
106-
applyGamma_video(n[2], g_b)]
107+
return None
108+
return [applyGamma_video(n[0], g_r),
109+
applyGamma_video(n[1], g_g),
110+
applyGamma_video(n[2], g_b)]
107111

108112

109113
def napplyGamma_video(n, g_r=GFACTOR, g_g=None, g_b=None):
@@ -266,3 +270,6 @@ def hsv2rgb_spectrum(hsv):
266270
return [(((((r * sat1) >> 8) + sat2) * val1) >> 8) & 0xFF,
267271
(((((g * sat1) >> 8) + sat2) * val1) >> 8) & 0xFF,
268272
(((((b * sat1) >> 8) + sat2) * val1) >> 8) & 0xFF]
273+
274+
275+
# pylint: enable=invalid-name

0 commit comments

Comments
 (0)