Skip to content

Commit 22432fe

Browse files
committed
Fix pylint fluff
1 parent fe4c7b1 commit 22432fe

File tree

8 files changed

+31
-21
lines changed

8 files changed

+31
-21
lines changed

adafruit_seesaw/crickit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
try:
3030
from micropython import const
3131
except ImportError:
32-
def const(x): return x
32+
def const(x):
33+
return x
3334

3435
__version__ = "0.0.0-auto.0"
3536
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_seesaw.git"

adafruit_seesaw/digitalio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def switch_to_input(self, pull=None):
6363
"""Switch the pin to input mode"""
6464
if pull == digitalio.Pull.DOWN:
6565
raise ValueError("Pull Down currently not supported")
66-
elif pull == digitalio.Pull.UP:
66+
if pull == digitalio.Pull.UP:
6767
self._seesaw.pin_mode(self._pin, self._seesaw.INPUT_PULLUP)
6868
else:
6969
self._seesaw.pin_mode(self._pin, self._seesaw.INPUT)
@@ -116,9 +116,9 @@ def pull(self):
116116
def pull(self, mode):
117117
if self._direction == digitalio.Direction.OUTPUT:
118118
raise AttributeError("cannot set pull on an output pin")
119-
elif mode == digitalio.Pull.DOWN:
119+
if mode == digitalio.Pull.DOWN:
120120
raise ValueError("Pull Down currently not supported")
121-
elif mode == digitalio.Pull.UP:
121+
if mode == digitalio.Pull.UP:
122122
self._seesaw.pin_mode(self._pin, self._seesaw.INPUT_PULLUP)
123123
elif mode is None:
124124
self._seesaw.pin_mode(self._pin, self._seesaw.INPUT)

adafruit_seesaw/keypad.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
try:
3030
from micropython import const
3131
except ImportError:
32-
def const(x): return x
32+
def const(x):
33+
return x
3334
from adafruit_seesaw.seesaw import Seesaw
3435

3536
__version__ = "0.0.0-auto.0"
@@ -63,13 +64,13 @@ class Keypad(Seesaw):
6364
:param int addr: I2C address of the SeeSaw device
6465
:param ~digitalio.DigitalInOut drdy: Pin connected to SeeSaw's 'ready' output"""
6566

66-
"""Indicates that the key is currently pressed"""
67+
#: Indicates that the key is currently pressed
6768
EDGE_HIGH = 0
68-
"""Indicates that the key is currently released"""
69+
#: Indicates that the key is currently released
6970
EDGE_LOW = 1
70-
"""Indicates that the key was recently pressed"""
71+
#: Indicates that the key was recently pressed
7172
EDGE_FALLING = 2
72-
"""Indicates that the key was recently released"""
73+
#: Indicates that the key was recently released
7374
EDGE_RISING = 3
7475

7576
def __init__(self, i2c_bus, addr=0x49, drdy=None):

adafruit_seesaw/neopixel.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
try:
3434
from micropython import const
3535
except ImportError:
36-
def const(x): return x
36+
def const(x):
37+
return x
3738

3839
__version__ = "1.2.3"
3940
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_seesaw.git"
@@ -66,7 +67,8 @@ class NeoPixel:
6667
:param int bpp: The number of bytes per pixel
6768
:param float brightness: The brightness, from 0.0 to 1.0
6869
:param bool auto_write: Automatically update the pixels when changed
69-
:param tuple pixel_order: The layout of the pixels. Use one of the order constants such as RGBW.
70+
:param tuple pixel_order: The layout of the pixels.
71+
Use one of the order constants such as RGBW.
7072
"""
7173
def __init__(self, seesaw, pin, n, *, bpp=3, brightness=1.0, auto_write=True, pixel_order=None):
7274
# TODO: brightness not yet implemented.

adafruit_seesaw/robohat.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
try:
3030
from micropython import const
3131
except ImportError:
32-
def const(x): return x
32+
def const(x):
33+
return x
3334

3435
__version__ = "0.0.0-auto.0"
3536
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_seesaw.git"
@@ -89,22 +90,22 @@ class MM1_Pinmap:
8990
# analog[0]:47 analog[1]:48 analog[2]: analog[3]:
9091
# analog[4]: analog[5]: analog[6]: analog[7]:
9192
#
92-
"""The pins capable of analog output"""
93+
#: The pins capable of analog output
9394
analog_pins = (_MM1_D3, _MM1_D2)
9495

95-
"""The effective bit resolution of the PWM pins"""
96+
#: The effective bit resolution of the PWM pins
9697
pwm_width = 16
9798

9899
# seesaw firmware (mm1_hat) pwm pin map:
99100
# pwm[0]:16 pwm[1]:17 pwm[2]:18 pwm[3]:19 pwm[4]:11 pwm[5]:10
100101
# pwm[6]:9 pwm[7]:8 pwm[8]:40 pwm[9]:41 pwm[10]:42 pwm[11]:43
101102
#
102-
"""The pins capable of PWM output"""
103+
#: The pins capable of PWM output
103104
pwm_pins = (_MM1_SERVO1, _MM1_SERVO2, _MM1_SERVO3, _MM1_SERVO4,
104105
_MM1_SERVO5, _MM1_SERVO6, _MM1_SERVO7, _MM1_SERVO8,
105106
_MM1_D12, _MM1_D10, _MM1_D11, _MM1_D9)
106107

107108
# seesaw firmware touch pin map:
108109
# touch[0]: 7 touch[1]: 6 touch[2]: 5 touch[3]: 4
109-
"""The pins capable of touch input"""
110+
#: The pins capable of touch input
110111
touch_pins = (_MM1_RCH1, _MM1_RCH2, _MM1_RCH3, _MM1_RCH4)

adafruit_seesaw/samd09.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
try:
3030
from micropython import const
3131
except ImportError:
32-
def const(x): return x
32+
def const(x):
33+
return x
3334

3435
__version__ = "0.0.0-auto.0"
3536
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_seesaw.git"
@@ -50,7 +51,7 @@ class SAMD09_Pinmap:
5051
5152
It is also a reference for the capabilities of each pin."""
5253

53-
"""The pins capable of analog output"""
54+
#: The pins capable of analog output
5455
analog_pins = (_ADC_INPUT_0_PIN, _ADC_INPUT_1_PIN,
5556
_ADC_INPUT_2_PIN, _ADC_INPUT_3_PIN)
5657

adafruit_seesaw/seesaw.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
try:
5656
from micropython import const
5757
except ImportError:
58-
def const(x): return x
58+
def const(x):
59+
return x
5960

6061
from adafruit_bus_device.i2c_device import I2CDevice
6162

@@ -159,6 +160,7 @@ def sw_reset(self):
159160
.format(chip_id, _HW_ID_CODE))
160161

161162
pid = self.get_version() >> 16
163+
# pylint: disable=import-outside-toplevel
162164
if pid == _CRICKIT_PID:
163165
from adafruit_seesaw.crickit import Crickit_Pinmap
164166
self.pin_mapping = Crickit_Pinmap
@@ -168,6 +170,7 @@ def sw_reset(self):
168170
else:
169171
from adafruit_seesaw.samd09 import SAMD09_Pinmap
170172
self.pin_mapping = SAMD09_Pinmap
173+
# pylint: enable=import-outside-toplevel
171174

172175
def get_options(self):
173176
"""Retrieve the 'options' word from the SeeSaw board"""

adafruit_seesaw/tftshield18.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
try:
3232
from micropython import const
3333
except ImportError:
34-
def const(x): return x
34+
def const(x):
35+
return x
3536
from adafruit_seesaw.seesaw import Seesaw
3637

3738
__version__ = "0.0.0-auto.0"
@@ -70,7 +71,7 @@ class TFTShield18(Seesaw):
7071
(1 << _BUTTON_C))
7172
except TypeError:
7273
# During Sphinx build, the following error occurs:
73-
# File "/home/jepler/src/Adafruit_CircuitPython_seesaw/adafruit_seesaw/tftshield18.py", line 60, in TFTShield18
74+
# File ".../tftshield18.py", line 60, in TFTShield18
7475
# (1 << _BUTTON_B) |
7576
# TypeError: unsupported operand type(s) for <<: 'int' and '_MockObject'
7677
_button_mask = 0xff

0 commit comments

Comments
 (0)