Skip to content

Commit d9de15c

Browse files
committed
Ran black and pylint fixes
1 parent aefdd6f commit d9de15c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

adafruit_display_shapes/sparkline.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# SPDX-FileCopyrightText: 2020 Kevin Matocha
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
# class of sparklines in CircuitPython
2-
# created by Kevin Matocha - Copyright 2020 (C)
36

47
# See the bottom for a code example using the `sparkline` Class.
58

@@ -34,6 +37,8 @@
3437
3538
"""
3639

40+
#pylint: disable=too-many-instance-attributes
41+
3742
import displayio
3843
from adafruit_display_shapes.line import Line
3944

@@ -85,6 +90,13 @@ def __init__(
8590
max_size=self._max_items - 1, x=x, y=y
8691
) # self is a group of lines
8792

93+
def clear_values(self):
94+
"""Removes all values from the _spark_list list and removes all lines in the group"""
95+
96+
for _ in range(len(self)): # remove all items from the current group
97+
self.pop()
98+
self._spark_list = [] # empty the list
99+
88100
def add_value(self, value):
89101
"""Add a value to the sparkline.
90102
:param value: The value to be added to the sparkline

0 commit comments

Comments
 (0)