Skip to content

Print error about missing waveform library #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions adafruit_rtttl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@
import pwmio

AUDIOIO_AVAILABLE = False
WAVEFORM_AVAILABLE = False
try:
import audioio
from adafruit_waveform import sine

AUDIOIO_AVAILABLE = True
from adafruit_waveform import sine

WAVEFORM_AVAILABLE = True
try:
import audiocore
except ImportError:
audiocore = audioio
except ImportError:
pass
except ImportError as e:
if not WAVEFORM_AVAILABLE:
raise e

try:
from typing import Optional, Union, Tuple, List
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"sphinx.ext.viewcode",
]

autodoc_mock_imports = ["pulseio", "pwmio", "audioio"]
autodoc_mock_imports = ["pulseio", "pwmio", "audioio", "adafruit_waveform"]

intersphinx_mapping = {
"python": ("https://docs.python.org/3.4", None),
Expand Down