Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Rename `verbose` to verbosity.

Aathish Sivasubrahmanian36495f4cd44c
diff --git a/manim/__main__.py b/manim/__main__.py
index caf8e1af4..4f0275865 100644
--- a/manim/__main__.py
+++ b/manim/__main__.py
@@ -19,7 +19,7 @@ from .logger import logger, console
def open_file_if_needed(file_writer):
- if file_writer_config["verbose"] != "DEBUG":
+ if file_writer_config["verbosity"] != "DEBUG":
curr_stdout = sys.stdout
sys.stdout = open(os.devnull, "w")
@@ -43,7 +43,7 @@ def open_file_if_needed(file_writer):
for file_path in file_paths:
open_media_file(file_path, file_writer_config["show_in_file_browser"])
- if file_writer_config["verbose"] != "DEBUG":
+ if file_writer_config["verbosity"] != "DEBUG":
sys.stdout.close()
sys.stdout = curr_stdout
diff --git a/manim/config.py b/manim/config.py
index 1b679a2e4..57ad84420 100644
--- a/manim/config.py
+++ b/manim/config.py
@@ -88,7 +88,7 @@ def _parse_config(config_parser, args):
args, config_parser, file_writer_config, successfully_read_files = _run_config()
-logger.setLevel(file_writer_config["verbose"])
+logger.setLevel(file_writer_config["verbosity"])
if _from_command_line():
logger.debug(
f"Read configuration files: {[os.path.abspath(cfgfile) for cfgfile in successfully_read_files]}"
diff --git a/manim/constants.py b/manim/constants.py
index 81674b220..45d9b16dd 100644
--- a/manim/constants.py
+++ b/manim/constants.py
@@ -152,11 +152,11 @@ COLOR_MAP.update(
)
PALETTE = list(COLOR_MAP.values())
locals().update(COLOR_MAP)
-VERBOSE_FFMPEG_MAP = {
+FFMPEG_VERBOSITY_MAP = {
"DEBUG": "error",
"INFO": "error",
"WARNING": "error",
"ERROR": "error",
"CRITICAL": "fatal",
}
-VERBOSE_CHOICES = VERBOSE_FFMPEG_MAP.keys()
+VERBOSITY_CHOICES = FFMPEG_VERBOSITY_MAP.keys()
diff --git a/manim/default.cfg b/manim/default.cfg
index 28beeaea6..5786bc2a1 100644
--- a/manim/default.cfg
+++ b/manim/default.cfg
@@ -36,8 +36,8 @@ preview = False
# -f, --show_in_file_browser
show_in_file_browser = False
-# -v, --verbose
-verbose = INFO
+# -v, --verbosity
+verbosity = INFO
# --progress_bar
progress_bar = True
diff --git a/manim/utils/config_utils.py b/manim/utils/config_utils.py
index 20a76a510..9d445fcc2 100644
--- a/manim/utils/config_utils.py
+++ b/manim/utils/config_utils.py
@@ -138,15 +138,15 @@ def _parse_file_writer_config(config_parser, args):
fw_config["max_files_cached"] = default.getint("max_files_cached")
if fw_config["max_files_cached"] == -1:
fw_config["max_files_cached"] = float("inf")
- # Parse the verbose flag to read in the log level
- verbose = getattr(args, "verbose")
- verbose = default["verbose"] if verbose is None else verbose
- fw_config["verbose"] = verbose
+ # Parse the verbosity flag to read in the log level
+ verbosity = getattr(args, "verbosity")
+ verbosity = default["verbosity"] if verbosity is None else verbosity
+ fw_config["verbosity"] = verbosity
# Parse the ffmpeg log level in the config
ffmpeg_loglevel = config_parser["ffmpeg"].get("loglevel", None)
fw_config["ffmpeg_loglevel"] = (
- constants.VERBOSE_FFMPEG_MAP[verbose]
+ constants.FFMPEG_VERBOSITY_MAP[verbosity]
if ffmpeg_loglevel is None
else ffmpeg_loglevel
)
@@ -385,10 +385,10 @@ def _parse_cli(arg_list, input=True):
# Specify the verbosity
parser.add_argument(
"-v",
- "--verbose",
+ "--verbosity",
type=str,
help="Verbosity level. Also changes the ffmpeg log level unless the latter is specified in the config",
- choices=constants.VERBOSE_CHOICES,
+ choices=constants.VERBOSITY_CHOICES,
)
# Specify if the progress bar should be displayed
diff --git a/tests/test_cli/manim.cfg b/tests/test_cli/manim.cfg
index 4388b0309..ae9ef35bc 100644
--- a/tests/test_cli/manim.cfg
+++ b/tests/test_cli/manim.cfg
@@ -2,7 +2,7 @@
movie_file_extension = .mp4
write_to_movie = True
sound = True
-verbose = DEBUG
+verbosity = DEBUG
# write_all = False
save_last_frame = True
# save_pngs = False
diff --git a/tests/tests_data/manim.cfg b/tests/tests_data/manim.cfg
index c7990a950..069801255 100644
--- a/tests/tests_data/manim.cfg
+++ b/tests/tests_data/manim.cfg
@@ -4,7 +4,7 @@ write_to_movie = True
# write_all = False
save_last_frame = False
# save_pngs = False
-verbose = DEBUG
+verbosity = DEBUG
[logger]
log_width = 512