Skip to content

Commit 97e36fa

Browse files
committed
fix lint or at least make pylint happy
1 parent dd60236 commit 97e36fa

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ spelling-store-unknown-words=no
119119
[MISCELLANEOUS]
120120

121121
# List of note tags to take in consideration, separated by a comma.
122-
notes=FIXME,XXX,TODO
122+
# notes=FIXME,XXX,TODO
123+
notes=FIXME,XXX
123124

124125

125126
[TYPECHECK]

neopixel.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
# Copyright (c) 2016 Damien P. George
44
# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
5+
# Copyright (c) 2019 Carter Nelson
6+
# Copyright (c) 2019 Roy Hooper
57
#
68
# Permission is hereby granted, free of charge, to any person obtaining a copy
79
# of this software and associated documentation files (the "Software"), to deal
@@ -25,11 +27,9 @@
2527
`neopixel` - NeoPixel strip driver
2628
====================================================
2729
28-
* Author(s): Damien P. George & Scott Shawcroft
30+
* Author(s): Damien P. George, Scott Shawcroft, Carter Nelson, Roy Hooper
2931
"""
3032

31-
import math
32-
3333
try:
3434
# imports needed for main NeoPixel class
3535
import digitalio
@@ -59,9 +59,6 @@
5959

6060

6161
class NeoPixel(_pixelbuf.PixelBuf):
62-
63-
bpp = None
64-
n = 0
6562
"""
6663
A sequence of neopixels.
6764
@@ -102,17 +99,18 @@ class NeoPixel(_pixelbuf.PixelBuf):
10299
pixels[::2] = [RED] * (len(pixels) // 2)
103100
time.sleep(2)
104101
"""
102+
105103
def __init__(self, pin, n, *, bpp=3, brightness=1.0, auto_write=True, pixel_order=None):
104+
self.bpp = bpp
105+
self.n = n
106106
self._configure(n, bpp, brightness, auto_write, pixel_order)
107107
self.pin = digitalio.DigitalInOut(pin)
108108
self.pin.direction = digitalio.Direction.OUTPUT
109109

110-
def _configure(self, n, bpp=3, brightness=1.0, auto_write=True, pixel_order=None):
111-
self.bpp = bpp
112-
self.n = n
110+
def _configure(self, n, bpp=3, brightness=1.0, auto_write=True, pixel_order=None): # pylint: disable=too-many-arguments
113111
if not pixel_order:
114112
pixel_order = GRB if bpp == 3 else GRBW
115-
else:
113+
else:
116114
self.bpp = bpp = len(pixel_order)
117115
if isinstance(pixel_order, tuple):
118116
order_chars = RGBW
@@ -159,7 +157,7 @@ def show(self):
159157

160158
class NeoPixel_SPI(NeoPixel):
161159
"""
162-
A sequence of neopixels.
160+
A sequence of neopixels using SPI.
163161
164162
:param ~busio.SPI spi: The SPI bus to output neopixel data on.
165163
:param int n: The number of neopixels in the chain
@@ -180,7 +178,7 @@ class NeoPixel_SPI(NeoPixel):
180178
pixels = neopixel.NeoPixel_SPI(board.SPI(), 10)
181179
pixels.fill(0xff0000)
182180
"""
183-
#pylint: disable=invalid-name, super-init-not-called
181+
# pylint: disable=invalid-name, super-init-not-called, import-outside-toplevel
184182

185183
FREQ = 6400000 # 800kHz * 8, actual may be different
186184
TRST = 80e-6 # Reset code low level time

0 commit comments

Comments
 (0)