Skip to content

Commit bbccf26

Browse files
authored
Merge pull request #93 from adafruit/pylint-update
Ran black, updated to pylint 2.x
2 parents 29a457b + d387561 commit bbccf26

17 files changed

+600
-428
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
source actions-ci/install.sh
4141
- name: Pip install pylint, black, & Sphinx
4242
run: |
43-
pip install --force-reinstall pylint==1.9.2 black==19.10b0 Sphinx sphinx-rtd-theme
43+
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
4444
- name: Library version
4545
run: git describe --dirty --always --tags
4646
- name: PyLint

adafruit_esp32spi/PWMOut.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
* Author(s): Brent Rubell
2828
"""
2929

30-
class PWMOut():
30+
31+
class PWMOut:
3132
"""
3233
Implementation of CircuitPython PWMOut for ESP32SPI.
3334
@@ -37,16 +38,18 @@ class PWMOut():
3738
:param int frequency: The target frequency in Hertz (32-bit).
3839
:param bool variable_frequency: True if the frequency will change over time.
3940
"""
40-
ESP32_PWM_PINS = set([0, 1, 2, 4, 5,
41-
12, 13, 14, 15,
42-
16, 17, 18, 19,
43-
21, 22, 23, 25,
44-
26, 27, 32, 33])
45-
def __init__(self, esp, pwm_pin, *, frequency=500, duty_cycle=0, variable_frequency=False):
41+
42+
ESP32_PWM_PINS = set(
43+
[0, 1, 2, 4, 5, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33]
44+
)
45+
46+
def __init__(
47+
self, esp, pwm_pin, *, frequency=500, duty_cycle=0, variable_frequency=False
48+
):
4649
if pwm_pin in self.ESP32_PWM_PINS:
4750
self._pwm_pin = pwm_pin
4851
else:
49-
raise AttributeError("Pin %d is not a valid ESP32 GPIO Pin."%pwm_pin)
52+
raise AttributeError("Pin %d is not a valid ESP32 GPIO Pin." % pwm_pin)
5053
self._esp = esp
5154
self._duty_cycle = duty_cycle
5255
self._freq = frequency
@@ -67,8 +70,10 @@ def deinit(self):
6770
def _is_deinited(self):
6871
"""Checks if PWMOut object has been previously de-initalized"""
6972
if self._pwm_pin is None:
70-
raise ValueError("PWMOut Object has been deinitialized and can no longer "
71-
"be used. Create a new PWMOut object.")
73+
raise ValueError(
74+
"PWMOut Object has been deinitialized and can no longer "
75+
"be used. Create a new PWMOut object."
76+
)
7277

7378
@property
7479
def duty_cycle(self):

0 commit comments

Comments
 (0)