Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fix some Path Changes - Use Relative Paths

Syrus Darkb412ec090c1d
diff --git a/manim/config.py b/manim/config.py
index 5ab17cabd..460e87f88 100644
--- a/manim/config.py
+++ b/manim/config.py
@@ -89,7 +89,7 @@ def _parse_config(config_parser, args):
args, config_parser, file_writer_config, successfully_read_files = _run_config()
if _from_command_line():
- logger.info(f"Read configuration files: {os.path.abspath(successfully_read_files[-1])}")
+ logger.info(f"Read configuration files: {os.path.relpath(successfully_read_files[-1])}")
_init_dirs(file_writer_config)
config = _parse_config(config_parser, args)
camera_config = config
diff --git a/manim/utils/config_utils.py b/manim/utils/config_utils.py
index a6c7fb187..78b579a84 100644
--- a/manim/utils/config_utils.py
+++ b/manim/utils/config_utils.py
@@ -56,7 +56,7 @@ def _parse_file_writer_config(config_parser, args):
# for str_opt in ['media_dir', 'video_dir', 'tex_dir', 'text_dir']:
for str_opt in ["media_dir"]:
attr = getattr(args, str_opt)
- fw_config[str_opt] = default[str_opt] if attr is None else attr
+ fw_config[str_opt] = os.path.relpath(default[str_opt]) if attr is None else attr
dir_names = {"video_dir": "videos", "tex_dir": "Tex", "text_dir": "texts"}
for name in dir_names:
fw_config[name] = os.path.join(fw_config["media_dir"], dir_names[name])
@@ -346,7 +346,7 @@ def _from_command_line():
def _paths_config_file():
- library_wide = os.path.abspath(
+ library_wide = os.path.relpath(
os.path.join(os.path.dirname(__file__), "..", "default.cfg")
)
if sys.platform.startswith("linux"):