Skip to content

Commit

Permalink
Reformat using Black
Browse files Browse the repository at this point in the history
  • Loading branch information
bbye98 committed Aug 20, 2024
1 parent 8840adc commit b7bc655
Show file tree
Hide file tree
Showing 15 changed files with 3,197 additions and 2,437 deletions.
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

sys.path.insert(0, f"{Path(__file__).resolve().parents[2]}/src")
from minim import VERSION # noqa: E402
from minim import VERSION # noqa: E402

now = datetime.now()

Expand Down Expand Up @@ -34,7 +34,7 @@
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode"
"sphinx.ext.viewcode",
]
exclude_patterns = ["_build"]
templates_path = ["_templates"]
Expand All @@ -45,7 +45,7 @@
intersphinx_mapping = {
"mutagen": ("https://mutagen.readthedocs.io/en/latest/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"python": ("https://docs.python.org/3/", None)
"python": ("https://docs.python.org/3/", None),
}
myst_enable_extensions = ["colon_fence"]
myst_heading_anchors = 3
Expand All @@ -61,4 +61,4 @@
html_show_sourcelink = False
html_static_path = ["_static"]
html_theme = "furo"
html_theme_options = {"sidebar_hide_name": True}
html_theme_options = {"sidebar_hide_name": True}
42 changes: 29 additions & 13 deletions src/minim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@
import warnings

__all__ = [
"audio", "discogs", "itunes", "qobuz", "spotify", "tidal", "utility",
"FOUND_FFMPEG", "FOUND_FLASK", "FOUND_PLAYWRIGHT",
"VERSION", "REPOSITORY_URL", "DIR_HOME", "DIR_TEMP", "ILLEGAL_CHARACTERS"
"audio",
"discogs",
"itunes",
"qobuz",
"spotify",
"tidal",
"utility",
"FOUND_FFMPEG",
"FOUND_FLASK",
"FOUND_PLAYWRIGHT",
"VERSION",
"REPOSITORY_URL",
"DIR_HOME",
"DIR_TEMP",
"ILLEGAL_CHARACTERS",
]

FOUND_FFMPEG = shutil.which("ffmpeg") is not None
Expand All @@ -22,22 +34,26 @@
if FOUND_FFMPEG:
_ = subprocess.run(["ffmpeg", "-version"], capture_output=True)
FFMPEG_CODECS = {
"aac": "libfdk_aac" if b"--enable-libfdk-aac" in _.stdout
else "aac",
"vorbis": "libvorbis" if b"--enable-libvorbis" in _.stdout
else "vorbis -strict experimental"
"aac": "libfdk_aac" if b"--enable-libfdk-aac" in _.stdout else "aac",
"vorbis": (
"libvorbis"
if b"--enable-libvorbis" in _.stdout
else "vorbis -strict experimental"
),
}
__all__.append("FFMPEG_CODECS")
else:
wmsg = ("FFmpeg was not found, so certain key features in Minim "
"are unavailable. To install FFmpeg, visit "
"https://ffmpeg.org/download.html or use "
"'conda install ffmpeg' if Conda is available.")
wmsg = (
"FFmpeg was not found, so certain key features in Minim "
"are unavailable. To install FFmpeg, visit "
"https://ffmpeg.org/download.html or use "
"'conda install ffmpeg' if Conda is available."
)
warnings.warn(wmsg)

DIR_HOME = pathlib.Path.home()
DIR_TEMP = pathlib.Path(tempfile.gettempdir())
ILLEGAL_CHARACTERS = {ord(c): '_' for c in '<>:"/\\|?*'}
ILLEGAL_CHARACTERS = {ord(c): "_" for c in '<>:"/\\|?*'}

_config = configparser.ConfigParser()
_config.read(DIR_HOME / "minim.cfg")
Expand All @@ -46,4 +62,4 @@
with open(DIR_HOME / "minim.cfg", "w") as f:
_config.write(f)

from . import audio, discogs, itunes, qobuz, spotify, tidal, utility # noqa: E402
from . import audio, discogs, itunes, qobuz, spotify, tidal, utility # noqa: E402
Loading

0 comments on commit b7bc655

Please sign in to comment.