From 082a646d937014702ca5b542dfdb625f642e6f22 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Wed, 8 Apr 2020 16:46:30 -0400 Subject: [PATCH] Black reformatting with Python 3 target. --- adafruit_is31fl3731.py | 4 +-- docs/conf.py | 16 +++++------ examples/is31fl3731_ledshim_rainbow.py | 40 ++++++++++++++++++++------ 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index 4492c8d..cf4b673 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -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): """ @@ -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.""" diff --git a/docs/conf.py b/docs/conf.py index 766d563..ff09973 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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. @@ -140,7 +140,7 @@ ( master_doc, "AdafruitIS31FL3731Library.tex", - u"Adafruit IS31FL3731 Library Documentation", + "Adafruit IS31FL3731 Library Documentation", author, "manual", ), @@ -154,7 +154,7 @@ ( master_doc, "adafruitIS31FL3731library", - u"Adafruit IS31FL3731 Library Documentation", + "Adafruit IS31FL3731 Library Documentation", [author], 1, ) @@ -169,7 +169,7 @@ ( master_doc, "AdafruitIS31FL3731Library", - u"Adafruit IS31FL3731 Library Documentation", + "Adafruit IS31FL3731 Library Documentation", author, "AdafruitIS31FL3731Library", "One line description of project.", diff --git a/examples/is31fl3731_ledshim_rainbow.py b/examples/is31fl3731_ledshim_rainbow.py index d4ef8ba..3d658b0 100644 --- a/examples/is31fl3731_ledshim_rainbow.py +++ b/examples/is31fl3731_ledshim_rainbow.py @@ -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): @@ -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)