Skip to content

Commit fd30603

Browse files
committed
Fixes requested by reviewers
1 parent 6e0ec5c commit fd30603

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

.pylintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
300300

301301
# Good variable names which should always be accepted, separated by a comma
302302
# good-names=i,j,k,ex,Run,_
303-
good-names=r,g,b,i,j,k,n,ex,Run,_
303+
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_
304304

305305
# Include a hint for the correct naming format with invalid-name
306306
include-naming-hint=no
@@ -422,7 +422,7 @@ max-returns=6
422422
max-statements=50
423423

424424
# Minimum number of public methods for a class (see R0903).
425-
min-public-methods=2
425+
min-public-methods=1
426426

427427

428428
[EXCEPTIONS]

adafruit_rgb_display/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
"""import class color565"""
1+
"""Auto imports for Adafruit_CircuitPython_RGB_Display"""
22
from adafruit_rgb_display.rgb import color565

adafruit_rgb_display/rgb.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ def init(self):
5757
for command, data in self._INIT:
5858
self.write(command, data)
5959

60-
#pylint: disable-msg=too-many-arguments
61-
def _block(self, xpos0, ypos0, xpos1, ypos1, data=None):
60+
#pylint: disable-msg=invalid-name,too-many-arguments
61+
def _block(self, x0, y0, x1, y1, data=None):
6262
"""Read or write a block of data."""
63-
self.write(self._COLUMN_SET, self._encode_pos(xpos0, xpos1))
64-
self.write(self._PAGE_SET, self._encode_pos(ypos0, ypos1))
63+
self.write(self._COLUMN_SET, self._encode_pos(x0, x1))
64+
self.write(self._PAGE_SET, self._encode_pos(y0, y1))
6565
if data is None:
6666
size = struct.calcsize(self._DECODE_PIXEL)
6767
return self.read(self._RAM_READ,
68-
(xpos1 - xpos0 + 1) * (ypos1 - ypos0 + 1) * size)
68+
(x1 - x0 + 1) * (y1 - y0 + 1) * size)
6969
self.write(self._RAM_WRITE, data)
7070
return None
71-
#pylint: enable-msg=too-many-arguments
71+
#pylint: enable-msg=invalid-name,too-many-arguments
7272

73-
def _encode_pos(self, x, y): #pylint: disable-msg=invalid-name
73+
def _encode_pos(self, x, y):
7474
"""Encode a postion into bytes."""
7575
return struct.pack(self._ENCODE_POS, x, y)
7676

@@ -82,7 +82,7 @@ def _decode_pixel(self, data):
8282
"""Decode bytes into a pixel color."""
8383
return color565(*struct.unpack(self._DECODE_PIXEL, data))
8484

85-
def pixel(self, x, y, color=None): #pylint: disable-msg=invalid-name
85+
def pixel(self, x, y, color=None):
8686
"""Read or write a pixel."""
8787
if color is None:
8888
return self._decode_pixel(self._block(x, y, x, y))
@@ -92,7 +92,7 @@ def pixel(self, x, y, color=None): #pylint: disable-msg=invalid-name
9292
return None
9393

9494
#pylint: disable-msg=too-many-arguments
95-
def fill_rectangle(self, x, y, width, height, color): #pylint: disable-msg=invalid-name
95+
def fill_rectangle(self, x, y, width, height, color):
9696
"""Draw a filled rectangle."""
9797
x = min(self.width - 1, max(0, x))
9898
y = min(self.height - 1, max(0, y))
@@ -112,11 +112,11 @@ def fill(self, color=0):
112112
"""Fill whole screen."""
113113
self.fill_rectangle(0, 0, self.width, self.height, color)
114114

115-
def hline(self, x, y, width, color): #pylint: disable-msg=invalid-name
115+
def hline(self, x, y, width, color):
116116
"""Draw a horizontal line."""
117117
self.fill_rectangle(x, y, width, 1, color)
118118

119-
def vline(self, x, y, height, color): #pylint: disable-msg=invalid-name
119+
def vline(self, x, y, height, color):
120120
"""Draw a vertical line."""
121121
self.fill_rectangle(x, y, 1, height, color)
122122

0 commit comments

Comments
 (0)