diff --git a/manim_slides/commons.py b/manim_slides/commons.py index 83cacec..194721a 100644 --- a/manim_slides/commons.py +++ b/manim_slides/commons.py @@ -1,9 +1,12 @@ +from typing import Callable + import click from .defaults import CONFIG_PATH -def config_path_option(function): +def config_path_option(function) -> Callable: + """Wraps a function to add configuration path option.""" return click.option( "-c", "--config", @@ -14,7 +17,8 @@ def config_path_option(function): )(function) -def config_options(function): +def config_options(function) -> Callable: + """Wraps a function to add configuration options.""" function = config_path_option(function) function = click.option( "-f", "--force", is_flag=True, help="Overwrite any existing configuration file." diff --git a/manim_slides/defaults.py b/manim_slides/defaults.py index 23689fc..13cbc70 100644 --- a/manim_slides/defaults.py +++ b/manim_slides/defaults.py @@ -3,7 +3,6 @@ import platform import cv2 FONT_ARGS = (cv2.FONT_HERSHEY_SIMPLEX, 1, 255, 1, cv2.LINE_AA) -PIXELS_PER_CHARACTER = 20 FOLDER_PATH: str = "./slides" CONFIG_PATH: str = ".manim-slides.json" diff --git a/manim_slides/present.py b/manim_slides/present.py index 24a4053..5d500ce 100644 --- a/manim_slides/present.py +++ b/manim_slides/present.py @@ -37,7 +37,7 @@ class State(IntEnum): def now() -> int: - """Returns time.time() in seconds.""" + """Returns time.time() in milliseconds.""" return round(time.time() * 1000) @@ -292,7 +292,7 @@ class Display: ) cv2.resizeWindow(WINDOW_NAME, *resolution) - def resize_frame_to_screen(self, frame: np.ndarray): + def resize_frame_to_screen(self, frame: np.ndarray) -> np.ndarray: """ Resizes a given frame to match screen dimensions. diff --git a/manim_slides/wizard.py b/manim_slides/wizard.py index f41f7b9..68e31b2 100644 --- a/manim_slides/wizard.py +++ b/manim_slides/wizard.py @@ -7,7 +7,7 @@ import numpy as np from .commons import config_options from .config import Config -from .defaults import CONFIG_PATH, FONT_ARGS, PIXELS_PER_CHARACTER +from .defaults import CONFIG_PATH, FONT_ARGS WINDOW_NAME = "Manim Slides Configuration Wizard" WINDOW_SIZE = (120, 620) @@ -51,6 +51,7 @@ def init(config_path, force, merge, skip_interactive=False): def _init(config_path, force, merge, skip_interactive=False): + """Actual initialization code for configuration file, with optional interactive mode.""" if os.path.exists(config_path): click.secho(f"The `{CONFIG_PATH}` configuration file exists")