Skip to content

Commit f3b8455

Browse files
authored
Merge pull request #29 from adafruit/black-update
Black reformatting with Python 3 target.
2 parents bb87529 + 082a646 commit f3b8455

File tree

3 files changed

+40
-20
lines changed

3 files changed

+40
-20
lines changed

adafruit_is31fl3731.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,9 @@ class LedShim(Matrix):
421421
width = 28
422422
height = 3
423423

424-
425424
def __init__(self, i2c, address=0x75):
426425
super().__init__(i2c, address)
427426

428-
429427
# pylint: disable-msg=too-many-arguments
430428
def pixelrgb(self, x, r, g, b, blink=None, frame=None):
431429
"""
@@ -442,10 +440,10 @@ def pixelrgb(self, x, r, g, b, blink=None, frame=None):
442440
super().pixel(x, 1, g, blink, frame)
443441
super().pixel(x, 2, b, blink, frame)
444442

445-
446443
# pylint: disable=inconsistent-return-statements
447444
# pylint: disable=too-many-return-statements
448445
# pylint: disable=too-many-branches
446+
449447
@staticmethod
450448
def pixel_addr(x, y):
451449
"""Translate an x,y coordinate to a pixel index."""

docs/conf.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@
3939
master_doc = "index"
4040

4141
# General information about the project.
42-
project = u"Adafruit IS31FL3731 Library"
43-
copyright = u"2017 Radomir Dopieralski"
44-
author = u"Radomir Dopieralski"
42+
project = "Adafruit IS31FL3731 Library"
43+
copyright = "2017 Radomir Dopieralski"
44+
author = "Radomir Dopieralski"
4545

4646
# The version info for the project you're documenting, acts as replacement for
4747
# |version| and |release|, also used in various other places throughout the
4848
# built documents.
4949
#
5050
# The short X.Y version.
51-
version = u"1.0"
51+
version = "1.0"
5252
# The full version, including alpha/beta/rc tags.
53-
release = u"1.0"
53+
release = "1.0"
5454

5555
# The language for content autogenerated by Sphinx. Refer to documentation
5656
# for a list of supported languages.
@@ -140,7 +140,7 @@
140140
(
141141
master_doc,
142142
"AdafruitIS31FL3731Library.tex",
143-
u"Adafruit IS31FL3731 Library Documentation",
143+
"Adafruit IS31FL3731 Library Documentation",
144144
author,
145145
"manual",
146146
),
@@ -154,7 +154,7 @@
154154
(
155155
master_doc,
156156
"adafruitIS31FL3731library",
157-
u"Adafruit IS31FL3731 Library Documentation",
157+
"Adafruit IS31FL3731 Library Documentation",
158158
[author],
159159
1,
160160
)
@@ -169,7 +169,7 @@
169169
(
170170
master_doc,
171171
"AdafruitIS31FL3731Library",
172-
u"Adafruit IS31FL3731 Library Documentation",
172+
"Adafruit IS31FL3731 Library Documentation",
173173
author,
174174
"AdafruitIS31FL3731Library",
175175
"One line description of project.",

examples/is31fl3731_ledshim_rainbow.py

+31-9
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,36 @@
99
display = adafruit_is31fl3731.LedShim(i2c)
1010

1111
# This list 28 colors from a rainbow...
12-
rainbow=[
13-
(255, 0, 0) , (255, 54, 0) , (255, 109, 0) , (255, 163, 0) ,
14-
(255, 218, 0) , (236, 255, 0) , (182, 255, 0) , (127, 255, 0) ,
15-
(72, 255, 0) , (18, 255, 0) , (0, 255, 36) , (0, 255, 91) ,
16-
(0, 255, 145) , (0, 255, 200) , (0, 255, 255) , (0, 200, 255) ,
17-
(0, 145, 255) , (0, 91, 255) , (0, 36, 255) , (18, 0, 255) ,
18-
(72, 0, 255) , (127, 0, 255) , (182, 0, 255) , (236, 0, 255) ,
19-
(255, 0, 218) , (255, 0, 163) , (255, 0, 109) , (255, 0, 54)]
12+
rainbow = [
13+
(255, 0, 0),
14+
(255, 54, 0),
15+
(255, 109, 0),
16+
(255, 163, 0),
17+
(255, 218, 0),
18+
(236, 255, 0),
19+
(182, 255, 0),
20+
(127, 255, 0),
21+
(72, 255, 0),
22+
(18, 255, 0),
23+
(0, 255, 36),
24+
(0, 255, 91),
25+
(0, 255, 145),
26+
(0, 255, 200),
27+
(0, 255, 255),
28+
(0, 200, 255),
29+
(0, 145, 255),
30+
(0, 91, 255),
31+
(0, 36, 255),
32+
(18, 0, 255),
33+
(72, 0, 255),
34+
(127, 0, 255),
35+
(182, 0, 255),
36+
(236, 0, 255),
37+
(255, 0, 218),
38+
(255, 0, 163),
39+
(255, 0, 109),
40+
(255, 0, 54),
41+
]
2042

2143

2244
for y in range(3):
@@ -28,5 +50,5 @@
2850
while True:
2951
for offset in range(28):
3052
for x in range(28):
31-
r,g,b = rainbow[(x+offset)%28]
53+
r, g, b = rainbow[(x + offset) % 28]
3254
display.pixelrgb(x, r, g, b)

0 commit comments

Comments
 (0)