Skip to content

Commit 2c3c937

Browse files
authored
Merge pull request #23 from lesamouraipourpre/max_size
Remove max_size parameter
2 parents 03075ac + dde27d7 commit 2c3c937

File tree

3 files changed

+18
-27
lines changed

3 files changed

+18
-27
lines changed

adafruit_pyoa.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from adafruit_cursorcontrol.cursorcontrol_cursormanager import CursorManager
4141
except ImportError:
4242
pass
43+
import audiocore
4344
import audioio
4445
from adafruit_display_text.label import Label
4546
from adafruit_button import Button
@@ -53,13 +54,13 @@ class PYOA_Graphics:
5354
"""A choose your own adventure game framework."""
5455

5556
def __init__(self):
56-
self.root_group = displayio.Group(max_size=15)
57+
self.root_group = displayio.Group()
5758
self._display = board.DISPLAY
58-
self._background_group = displayio.Group(max_size=1)
59+
self._background_group = displayio.Group()
5960
self.root_group.append(self._background_group)
60-
self._text_group = displayio.Group(max_size=1)
61+
self._text_group = displayio.Group()
6162
self.root_group.append(self._text_group)
62-
self._button_group = displayio.Group(max_size=2)
63+
self._button_group = displayio.Group()
6364
self.root_group.append(self._button_group)
6465

6566
if self._display.height > 250:
@@ -203,10 +204,10 @@ def _display_buttons(self, card):
203204
self._right_button.label = button02_text
204205
if button01_text and not button02_text:
205206
# show only middle button
206-
self._button_group.append(self._middle_button.group)
207+
self._button_group.append(self._middle_button)
207208
if button01_text and button02_text:
208-
self._button_group.append(self._right_button.group)
209-
self._button_group.append(self._left_button.group)
209+
self._button_group.append(self._right_button)
210+
self._button_group.append(self._left_button)
210211

211212
def _display_background_for(self, card):
212213
"""If there's a background on card, display it.
@@ -346,7 +347,7 @@ def play_sound(self, filename, *, wait_to_finish=True, loop=False):
346347
except OSError as err:
347348
raise OSError("Could not locate sound file", filename) from err
348349

349-
wavedata = audioio.WaveFile(self._wavfile)
350+
wavedata = audiocore.WaveFile(self._wavfile)
350351
self._speaker_enable.value = True
351352
self.audio.play(wavedata, loop=loop)
352353
if loop or not wait_to_finish:

docs/conf.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,23 @@
2121
"sphinx.ext.todo",
2222
]
2323

24-
# TODO: Please Read!
2524
# Uncomment the below if you use native CircuitPython modules such as
2625
# digitalio, micropython and busio. List the modules you use. Without it, the
2726
# autodoc module docs will fail to generate with a warning.
2827
autodoc_mock_imports = [
29-
"rtc",
30-
"supervisor",
31-
"pulseio",
28+
"analogio",
29+
"audiocore",
3230
"audioio",
3331
"displayio",
34-
"neopixel",
3532
"microcontroller",
36-
"adafruit_touchscreen",
37-
"adafruit_bitmap_font",
38-
"adafruit_display_text",
39-
"adafruit_esp32spi",
40-
"secrets",
41-
"adafruit_sdcard",
33+
"neopixel",
34+
"pulseio",
35+
"rtc",
4236
"storage",
43-
"adafruit_io",
44-
"adafruit_button",
45-
"adafruit_cursorcontrol",
37+
"supervisor",
4638
"terminalio",
4739
]
4840

49-
5041
intersphinx_mapping = {
5142
"python": ("https://docs.python.org/3.4", None),
5243
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: Unlicense
44

5-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
6-
#
7-
# SPDX-License-Identifier: Unlicense
8-
95
Adafruit-Blinka
6+
adafruit-circuitpython-display-button
7+
adafruit-circuitpython-display-text
8+
adafruit-circuitpython-touchscreen

0 commit comments

Comments
 (0)