mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-07-15 00:52:15 +08:00
chore(ci): test builds on multiple oses (#7)
* chore(ci): test builds on multiple oses * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: add tqdm to setup * chore(ci): test builds on multiple oses * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: install deps in two steps * fix(bug): allows shape to be 2 or 3 dims * release new version * chore(ci): test builds on multiple oses * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore(ci): test builds on multiple oses * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: install deps in two steps * fix: deps string * fix: ci * fix: single quote strings * fix: choco install manimce * Add pyopengl * Update test_examples.yml * fix: custom 3d example for manimgl * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: virtual frame buffer * fix: add ffmpeg dep * feat(cli): add skip-all option for testing * chore(lint): black fmt * fix: typo in deps * fix: python -m pip install * fix: typo * Update test_examples.yml * fix: try fix * fix: pip install --user * pip install -e * only on windows * fix: tmp fix * fix: typo in int parsing * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update test_examples.yml * Update __version__.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -1 +1 @@
|
||||
__version__ = "3.2.2"
|
||||
__version__ = "3.2.3"
|
||||
|
@ -174,10 +174,18 @@ class Presentation:
|
||||
|
||||
|
||||
class Display:
|
||||
def __init__(self, presentations, config, start_paused=False, fullscreen=False):
|
||||
def __init__(
|
||||
self,
|
||||
presentations,
|
||||
config,
|
||||
start_paused=False,
|
||||
fullscreen=False,
|
||||
skip_all=False,
|
||||
):
|
||||
self.presentations = presentations
|
||||
self.start_paused = start_paused
|
||||
self.config = config
|
||||
self.skip_all = skip_all
|
||||
|
||||
self.state = State.PLAYING
|
||||
self.lastframe = None
|
||||
@ -206,7 +214,7 @@ class Display:
|
||||
|
||||
scale = min(scale_height, scale_width)
|
||||
|
||||
return cv2.resize(frame, (int(scale * frame_height, scale * frame_width)))
|
||||
return cv2.resize(frame, (int(scale * frame_height), int(scale * frame_width)))
|
||||
|
||||
@property
|
||||
def current_presentation(self):
|
||||
@ -293,7 +301,9 @@ class Display:
|
||||
):
|
||||
self.current_presentation.next()
|
||||
self.state = State.PLAYING
|
||||
elif self.state == State.PLAYING and self.config.CONTINUE.match(key):
|
||||
elif (
|
||||
self.state == State.PLAYING and self.config.CONTINUE.match(key)
|
||||
) or self.skip_all:
|
||||
self.current_presentation.next()
|
||||
elif self.config.BACK.match(key):
|
||||
if self.current_presentation.current_slide_i == 0:
|
||||
@ -356,8 +366,15 @@ def _list_scenes(folder):
|
||||
is_flag=True,
|
||||
help="Show the next animation first frame as last frame (hack).",
|
||||
)
|
||||
@click.option(
|
||||
"--skip-all",
|
||||
is_flag=True,
|
||||
help="Skip all slides, useful the test if slides are working.",
|
||||
)
|
||||
@click.help_option("-h", "--help")
|
||||
def present(scenes, config_path, folder, start_paused, fullscreen, last_frame_next):
|
||||
def present(
|
||||
scenes, config_path, folder, start_paused, fullscreen, last_frame_next, skip_all
|
||||
):
|
||||
"""Present the different scenes."""
|
||||
|
||||
if len(scenes) == 0:
|
||||
@ -411,6 +428,10 @@ def present(scenes, config_path, folder, start_paused, fullscreen, last_frame_ne
|
||||
config = Config()
|
||||
|
||||
display = Display(
|
||||
presentations, config=config, start_paused=start_paused, fullscreen=fullscreen
|
||||
presentations,
|
||||
config=config,
|
||||
start_paused=start_paused,
|
||||
fullscreen=fullscreen,
|
||||
skip_all=skip_all,
|
||||
)
|
||||
display.run()
|
||||
|
Reference in New Issue
Block a user