Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 10, 2022
1 parent 3e6c562 commit cda304f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 8 additions & 3 deletions manim_slides/manim.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from importlib.util import find_spec
import sys
from importlib.util import find_spec

MANIM_PACKAGE_NAME = "manim"
MANIM_AVAILABLE = find_spec(MANIM_PACKAGE_NAME) is not None
Expand All @@ -11,7 +11,10 @@

if MANIM_IMPORTED and MANIMGL_IMPORTED:
from manim import logger
logger.warn("Both manim and manimgl are installed, therefore `manim-slide` needs to need which one to use. Please only import one of the two modules so that `manim-slide` knows which one to use. Here, manim is used by default")

logger.warn(
"Both manim and manimgl are installed, therefore `manim-slide` needs to need which one to use. Please only import one of the two modules so that `manim-slide` knows which one to use. Here, manim is used by default"
)
MANIM = True
MANIMGL = False
elif MANIM_AVAILABLE and not MANIMGL_IMPORTED:
Expand All @@ -21,7 +24,9 @@
MANIM = False
MANIMGL = True
else:
raise ImportError("Either manim (community) or manimgl (3b1b) package must be installed")
raise ImportError(
"Either manim (community) or manimgl (3b1b) package must be installed"
)


FFMPEG_BIN = None
Expand Down
8 changes: 6 additions & 2 deletions manim_slides/present.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,16 @@ def value_proc(value: str):
indices = list(map(int, value.strip().replace(" ", "").split(",")))

if not all(map(lambda i: 0 < i <= len(scene_choices), indices)):
raise click.UsageError("Please only enter numbers displayed on the screen.")
raise click.UsageError(
"Please only enter numbers displayed on the screen."
)

return [scene_choices[i] for i in indices]

if len(scene_choices) == 0:
raise click.UsageError("No scenes were found, are you in the correct directory?")
raise click.UsageError(
"No scenes were found, are you in the correct directory?"
)

while True:
try:
Expand Down

0 comments on commit cda304f

Please sign in to comment.