Skip to content

Commit d9c8bd0

Browse files
committed
Tidy up some Pylint issues
1 parent 8407b23 commit d9c8bd0

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

Adafruit_ProgressBar/adafruit_progressbar.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(
7676
self._bitmap[line, _h] = 1
7777
self._bitmap[width - 1 - line, _h] = 1
7878

79-
super(ProgressBarBase, self).__init__(
79+
super().__init__(
8080
(x, y),
8181
(width, height),
8282
self.progress,
@@ -128,16 +128,6 @@ def fill(self):
128128
"""
129129
return self._palette[0]
130130

131-
@property
132-
def width(self):
133-
"""The width of the progress bar. In pixels, includes the border."""
134-
return self._bar_width
135-
136-
@property
137-
def height(self):
138-
"""The height of the progress bar. In pixels, includes the border."""
139-
return self._bar_height
140-
141131
@fill.setter
142132
def fill(self, color):
143133
"""Sets the fill of the progress bar. Can be a hex value for a color or ``None`` for
@@ -152,4 +142,6 @@ def fill(self, color):
152142
self._palette.make_opaque(0)
153143

154144
def render(self):
145+
print("Calling 'super().render()' before our own code")
155146
super().render()
147+
print("Calling own 'render()' code")

Adafruit_ProgressBar/adafruit_progressbar_base.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class ProgressBarBase(displayio.TileGrid):
5050
Default: 0x000000 (Black)
5151
"""
5252

53+
# pylint: disable=too-many-arguments
5354
def __init__(
5455
self,
5556
position: (int, int),
@@ -69,7 +70,7 @@ def __init__(
6970
self._palette[1] = outline_color
7071
self._palette[2] = bar_color
7172

72-
super(ProgressBarBase, self).__init__(
73+
super().__init__(
7374
self._bitmap,
7475
pixel_shader=self._palette,
7576
x=self._position[0],
@@ -84,36 +85,34 @@ def __init__(
8485

8586
@property.getter
8687
def width(self):
87-
"""The total width of the widget"""
88+
"""The total width of the widget, in pixels. Includes the border and margin."""
8889
return self._size[0]
8990

9091
@property.getter
9192
def height(self):
92-
"""The total height of the widget"""
93+
"""The total height of the widget, in pixels. Includes the border and margin."""
9394
return self._size[1]
9495

9596
@property.getter
9697
def x(self):
97-
"""The horizontal (x) position of the top-left corner of the widget"""
98+
"""The horizontal (x) position of the top-left corner of the widget."""
9899
return self._position[0]
99100

100101
@property.getter
101102
def y(self):
102-
"""The vertical (y) position of the top-left corner of the widget"""
103+
"""The vertical (y) position of the top-left corner of the widget."""
103104
return self._position[1]
104105

105-
@property
106-
def progress(self):
107-
"""The current displayed value of the widget"""
108-
return self._progress
109-
110106
@property.setter
111107
def progress(self, value):
112-
"""Sets/updates the displayed value"""
108+
"""The current displayed value of the widget.
109+
110+
:param float value: The new value which should be displayed by the progress
111+
bar. Must be between 0.0-1.0
112+
"""
113113
self._progress = value
114114
self.render()
115115

116116
def render(self):
117117
"""The method called when the display needs to be updated. This method
118118
can be overridden in child classes to handle the graphics appropriately."""
119-
pass

0 commit comments

Comments
 (0)