mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Remove utils/customization.py
This commit is contained in:
parent
b593cde317
commit
3b9ef57b22
6 changed files with 12 additions and 16 deletions
|
@ -64,7 +64,6 @@ from manimlib.utils.bezier import *
|
||||||
from manimlib.utils.cache import *
|
from manimlib.utils.cache import *
|
||||||
from manimlib.utils.color import *
|
from manimlib.utils.color import *
|
||||||
from manimlib.utils.dict_ops import *
|
from manimlib.utils.dict_ops import *
|
||||||
from manimlib.utils.customization import *
|
|
||||||
from manimlib.utils.debug import *
|
from manimlib.utils.debug import *
|
||||||
from manimlib.utils.directories import *
|
from manimlib.utils.directories import *
|
||||||
from manimlib.utils.file_ops import *
|
from manimlib.utils.file_ops import *
|
||||||
|
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from colour import Color
|
from colour import Color
|
||||||
|
|
||||||
|
from manimlib.config import get_global_config
|
||||||
from manimlib.constants import BLACK, RED, YELLOW, WHITE
|
from manimlib.constants import BLACK, RED, YELLOW, WHITE
|
||||||
from manimlib.constants import DL, DOWN, DR, LEFT, RIGHT, UL, UR
|
from manimlib.constants import DL, DOWN, DR, LEFT, RIGHT, UL, UR
|
||||||
from manimlib.constants import SMALL_BUFF
|
from manimlib.constants import SMALL_BUFF
|
||||||
|
@ -9,7 +10,6 @@ from manimlib.mobject.geometry import Line
|
||||||
from manimlib.mobject.geometry import Rectangle
|
from manimlib.mobject.geometry import Rectangle
|
||||||
from manimlib.mobject.types.vectorized_mobject import VGroup
|
from manimlib.mobject.types.vectorized_mobject import VGroup
|
||||||
from manimlib.mobject.types.vectorized_mobject import VMobject
|
from manimlib.mobject.types.vectorized_mobject import VMobject
|
||||||
from manimlib.utils.customization import get_customization
|
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class BackgroundRectangle(SurroundingRectangle):
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
if color is None:
|
if color is None:
|
||||||
color = get_customization()['style']['background_color']
|
color = get_global_config()['style']['background_color']
|
||||||
super().__init__(
|
super().__init__(
|
||||||
mobject,
|
mobject,
|
||||||
color=color,
|
color=color,
|
||||||
|
|
|
@ -12,6 +12,7 @@ import pygments
|
||||||
import pygments.formatters
|
import pygments.formatters
|
||||||
import pygments.lexers
|
import pygments.lexers
|
||||||
|
|
||||||
|
from manimlib.config import get_global_config
|
||||||
from manimlib.constants import DEFAULT_PIXEL_WIDTH, FRAME_WIDTH
|
from manimlib.constants import DEFAULT_PIXEL_WIDTH, FRAME_WIDTH
|
||||||
from manimlib.constants import NORMAL
|
from manimlib.constants import NORMAL
|
||||||
from manimlib.logger import log
|
from manimlib.logger import log
|
||||||
|
@ -19,7 +20,6 @@ from manimlib.mobject.svg.string_mobject import StringMobject
|
||||||
from manimlib.utils.cache import cache_on_disk
|
from manimlib.utils.cache import cache_on_disk
|
||||||
from manimlib.utils.color import color_to_hex
|
from manimlib.utils.color import color_to_hex
|
||||||
from manimlib.utils.color import int_to_hex
|
from manimlib.utils.color import int_to_hex
|
||||||
from manimlib.utils.customization import get_customization
|
|
||||||
from manimlib.utils.directories import get_downloads_dir
|
from manimlib.utils.directories import get_downloads_dir
|
||||||
from manimlib.utils.simple_functions import hash_string
|
from manimlib.utils.simple_functions import hash_string
|
||||||
|
|
||||||
|
@ -155,13 +155,14 @@ class MarkupText(StringMobject):
|
||||||
isolate: Selector = re.compile(r"\w+", re.U),
|
isolate: Selector = re.compile(r"\w+", re.U),
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
|
default_style = get_global_config()["style"]
|
||||||
self.text = text
|
self.text = text
|
||||||
self.font_size = font_size
|
self.font_size = font_size
|
||||||
self.justify = justify
|
self.justify = justify
|
||||||
self.indent = indent
|
self.indent = indent
|
||||||
self.alignment = alignment or get_customization()["style"]["text_alignment"]
|
self.alignment = alignment or default_style["text_alignment"]
|
||||||
self.line_width = line_width
|
self.line_width = line_width
|
||||||
self.font = font or get_customization()["style"]["font"]
|
self.font = font or default_style["font"]
|
||||||
self.slant = slant
|
self.slant = slant
|
||||||
self.weight = weight
|
self.weight = weight
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
from manimlib.config import get_global_config
|
|
||||||
|
|
||||||
|
|
||||||
def get_customization():
|
|
||||||
return get_global_config()
|
|
|
@ -5,13 +5,13 @@ import tempfile
|
||||||
import appdirs
|
import appdirs
|
||||||
|
|
||||||
|
|
||||||
|
from manimlib.config import get_global_config
|
||||||
from manimlib.config import get_manim_dir
|
from manimlib.config import get_manim_dir
|
||||||
from manimlib.utils.customization import get_customization
|
|
||||||
from manimlib.utils.file_ops import guarantee_existence
|
from manimlib.utils.file_ops import guarantee_existence
|
||||||
|
|
||||||
|
|
||||||
def get_directories() -> dict[str, str]:
|
def get_directories() -> dict[str, str]:
|
||||||
return get_customization()["directories"]
|
return get_global_config()["directories"]
|
||||||
|
|
||||||
|
|
||||||
def get_cache_dir() -> str:
|
def get_cache_dir() -> str:
|
||||||
|
|
|
@ -8,8 +8,8 @@ from moderngl_window.timers.clock import Timer
|
||||||
from screeninfo import get_monitors
|
from screeninfo import get_monitors
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
|
from manimlib.config import get_global_config
|
||||||
from manimlib.constants import FRAME_SHAPE
|
from manimlib.constants import FRAME_SHAPE
|
||||||
from manimlib.utils.customization import get_customization
|
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
@ -83,9 +83,10 @@ class Window(PygletWindow):
|
||||||
self.size = (w, h)
|
self.size = (w, h)
|
||||||
|
|
||||||
def find_initial_position(self, size: tuple[int, int]) -> tuple[int, int]:
|
def find_initial_position(self, size: tuple[int, int]) -> tuple[int, int]:
|
||||||
custom_position = get_customization()["window_position"]
|
global_config = get_global_config()
|
||||||
|
custom_position = global_config["window_position"]
|
||||||
|
mon_index = global_config["window_monitor"]
|
||||||
monitors = get_monitors()
|
monitors = get_monitors()
|
||||||
mon_index = get_customization()["window_monitor"]
|
|
||||||
monitor = monitors[min(mon_index, len(monitors) - 1)]
|
monitor = monitors[min(mon_index, len(monitors) - 1)]
|
||||||
window_width, window_height = size
|
window_width, window_height = size
|
||||||
# Position might be specified with a string of the form
|
# Position might be specified with a string of the form
|
||||||
|
|
Loading…
Add table
Reference in a new issue