Skip to content

Black reformatting with Python 3 target. #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions adafruit_is31fl3731.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,9 @@ class LedShim(Matrix):
width = 28
height = 3


def __init__(self, i2c, address=0x75):
super().__init__(i2c, address)


# pylint: disable-msg=too-many-arguments
def pixelrgb(self, x, r, g, b, blink=None, frame=None):
"""
Expand All @@ -442,10 +440,10 @@ def pixelrgb(self, x, r, g, b, blink=None, frame=None):
super().pixel(x, 1, g, blink, frame)
super().pixel(x, 2, b, blink, frame)


# pylint: disable=inconsistent-return-statements
# pylint: disable=too-many-return-statements
# pylint: disable=too-many-branches

@staticmethod
def pixel_addr(x, y):
"""Translate an x,y coordinate to a pixel index."""
Expand Down
16 changes: 8 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@
master_doc = "index"

# General information about the project.
project = u"Adafruit IS31FL3731 Library"
copyright = u"2017 Radomir Dopieralski"
author = u"Radomir Dopieralski"
project = "Adafruit IS31FL3731 Library"
copyright = "2017 Radomir Dopieralski"
author = "Radomir Dopieralski"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u"1.0"
version = "1.0"
# The full version, including alpha/beta/rc tags.
release = u"1.0"
release = "1.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -140,7 +140,7 @@
(
master_doc,
"AdafruitIS31FL3731Library.tex",
u"Adafruit IS31FL3731 Library Documentation",
"Adafruit IS31FL3731 Library Documentation",
author,
"manual",
),
Expand All @@ -154,7 +154,7 @@
(
master_doc,
"adafruitIS31FL3731library",
u"Adafruit IS31FL3731 Library Documentation",
"Adafruit IS31FL3731 Library Documentation",
[author],
1,
)
Expand All @@ -169,7 +169,7 @@
(
master_doc,
"AdafruitIS31FL3731Library",
u"Adafruit IS31FL3731 Library Documentation",
"Adafruit IS31FL3731 Library Documentation",
author,
"AdafruitIS31FL3731Library",
"One line description of project.",
Expand Down
40 changes: 31 additions & 9 deletions examples/is31fl3731_ledshim_rainbow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,36 @@
display = adafruit_is31fl3731.LedShim(i2c)

# This list 28 colors from a rainbow...
rainbow=[
(255, 0, 0) , (255, 54, 0) , (255, 109, 0) , (255, 163, 0) ,
(255, 218, 0) , (236, 255, 0) , (182, 255, 0) , (127, 255, 0) ,
(72, 255, 0) , (18, 255, 0) , (0, 255, 36) , (0, 255, 91) ,
(0, 255, 145) , (0, 255, 200) , (0, 255, 255) , (0, 200, 255) ,
(0, 145, 255) , (0, 91, 255) , (0, 36, 255) , (18, 0, 255) ,
(72, 0, 255) , (127, 0, 255) , (182, 0, 255) , (236, 0, 255) ,
(255, 0, 218) , (255, 0, 163) , (255, 0, 109) , (255, 0, 54)]
rainbow = [
(255, 0, 0),
(255, 54, 0),
(255, 109, 0),
(255, 163, 0),
(255, 218, 0),
(236, 255, 0),
(182, 255, 0),
(127, 255, 0),
(72, 255, 0),
(18, 255, 0),
(0, 255, 36),
(0, 255, 91),
(0, 255, 145),
(0, 255, 200),
(0, 255, 255),
(0, 200, 255),
(0, 145, 255),
(0, 91, 255),
(0, 36, 255),
(18, 0, 255),
(72, 0, 255),
(127, 0, 255),
(182, 0, 255),
(236, 0, 255),
(255, 0, 218),
(255, 0, 163),
(255, 0, 109),
(255, 0, 54),
]


for y in range(3):
Expand All @@ -28,5 +50,5 @@
while True:
for offset in range(28):
for x in range(28):
r,g,b = rainbow[(x+offset)%28]
r, g, b = rainbow[(x + offset) % 28]
display.pixelrgb(x, r, g, b)