Skip to content
Open
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
23 changes: 5 additions & 18 deletions manim/cli/init/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import cloup

from manim._config import console
from manim._config.utils import make_config_parser
from manim.constants import CONTEXT_SETTINGS, EPILOG, QUALITIES
from manim.utils.file_ops import (
add_import_statement,
Expand Down Expand Up @@ -122,25 +123,11 @@ def project(default_settings: bool, **kwargs: Any) -> None:
)
else:
project_name.mkdir()
new_cfg: dict[str, Any] = {}
new_cfg_path = Path.resolve(project_name / "manim.cfg")

if not default_settings:
for key, value in CFG_DEFAULTS.items():
if key == "scene_names":
new_cfg[key] = template_name + "Template"
elif key == "resolution":
new_cfg[key] = select_resolution()
else:
new_cfg[key] = click.prompt(f"\n{key}", default=value)

console.print("\n", new_cfg)
if click.confirm("Do you want to continue?", default=True, abort=True):
copy_template_files(project_name, template_name)
update_cfg(new_cfg, new_cfg_path)
else:
copy_template_files(project_name, template_name)
update_cfg(CFG_DEFAULTS, new_cfg_path)
parser = make_config_parser()
copy_template_files(project_name, template_name)
with new_cfg_path.open("w") as fp:
parser.write(fp)


@cloup.command(
Expand Down
Loading