Skip to content

Commit caee24a

Browse files
committed
Linting. Added .
1 parent ee53f4a commit caee24a

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

adafruit_slideshow.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
__version__ = "0.0.0-auto.0"
4949
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Slideshow.git"
5050

51+
5152
class PlayBackOrder:
5253
"""Defines possible slideshow playback orders."""
5354
# pylint: disable=too-few-public-methods
@@ -78,8 +79,9 @@ class SlideShow:
7879
:param str folder: Specify the folder containing the image files, in quotes. Default is
7980
the root directory, ``"/"``.
8081
81-
:param PlayBackOrder order: The order in which the images display. You can choose random (``RANDOM``) or
82-
alphabetical (``ALPHABETICAL``). Default is ``ALPHABETICAL``.
82+
:param PlayBackOrder order: The order in which the images display. You can choose random
83+
(``RANDOM``) or alphabetical (``ALPHABETICAL``). Default is
84+
``ALPHABETICAL``.
8385
8486
:param bool loop: Specify whether to loop the images or play through the list once. `True`
8587
if slideshow will continue to loop, ``False`` if it will play only once.
@@ -147,8 +149,9 @@ class SlideShow:
147149
slideshow.brightness -= 0.001
148150
"""
149151

150-
def __init__(self, display, backlight_pwm, *, folder="/", order=PlayBackOrder.ALPHABETICAL, loop=True,
151-
dwell=3, fade_effect=True, auto_advance=True, direction=PlayBackDirection.FORWARD):
152+
def __init__(self, display, backlight_pwm, *, folder="/", order=PlayBackOrder.ALPHABETICAL,
153+
loop=True, dwell=3, fade_effect=True, auto_advance=True,
154+
direction=PlayBackDirection.FORWARD):
152155
self.loop = loop
153156
"""Specifies whether to loop through the images continuously or play through the list once.
154157
``True`` will continue to loop, ``False`` will play only once."""
@@ -172,6 +175,7 @@ def __init__(self, display, backlight_pwm, *, folder="/", order=PlayBackOrder.AL
172175
self._img_start = None
173176
self._file_list = list(filter(lambda x: x.endswith("bmp"), os.listdir(folder)))
174177

178+
self._order = None
175179
self.order = order
176180
"""The order in which the images display. You can choose random (``RANDOM``) or
177181
alphabetical (``ALPHA``)."""
@@ -190,6 +194,10 @@ def __init__(self, display, backlight_pwm, *, folder="/", order=PlayBackOrder.AL
190194
# Show the first image
191195
self.advance()
192196

197+
@property
198+
def current_image_name(self):
199+
return self._file_list[self._current_image]
200+
193201
@property
194202
def order(self):
195203
"""Specifies the order in which the images are displayed. Options are random (``RANDOM``) or

examples/slideshow_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from adafruit_slideshow import PlayBackOrder, SlideShow
21
import board
2+
from adafruit_slideshow import PlayBackOrder, SlideShow
33
import pulseio
44

55
# Create the slideshow object that plays through once alphabetically.

examples/slideshow_touch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from adafruit_slideshow import PlayBackOrder, SlideShow, PlayBackDirection
2-
import touchio
31
import board
2+
from adafruit_slideshow import SlideShow, PlayBackDirection
3+
import touchio
44
import pulseio
55

66
forward_button = touchio.TouchIn(board.TOUCH4)

0 commit comments

Comments
 (0)