A community-maintained Python framework for creating mathematical animations.
Use os.devnull instead of utils.tex_file_writing.get_null(); also small typos that cause SyntaxError (#382)
Thomas Zhu47d8caa80e48
diff --git a/manimlib/utils/sounds.py b/manimlib/utils/sounds.pyindex 10b1faba3..e9d3dc7ec 100644--- a/manimlib/utils/sounds.py+++ b/manimlib/utils/sounds.py@@ -13,7 +13,8 @@ def play_chord(*nums):for num in nums] + ["fade h 0.5 1 0.5",- "> /dev/null"+ ">",+ os.devnull]try:os.system(" ".join(commands))diff --git a/manimlib/utils/tex_file_writing.py b/manimlib/utils/tex_file_writing.pyindex 061f19574..7bfcbf1be 100644--- a/manimlib/utils/tex_file_writing.py+++ b/manimlib/utils/tex_file_writing.py@@ -37,12 +37,6 @@ def generate_tex_file(expression, template_tex_file_body):return result-def get_null():- if os.name == "nt":- return "NUL"- return "/dev/null"--def tex_to_dvi(tex_file):result = tex_file.replace(".tex", ".dvi" if not TEX_USE_CTEX else ".xdv")if not os.path.exists(result):@@ -53,7 +47,7 @@ def tex_to_dvi(tex_file):"-output-directory=" + TEX_DIR,tex_file,">",- get_null()+ os.devnull] if not TEX_USE_CTEX else ["xelatex","-no-pdf",@@ -62,7 +56,7 @@ def tex_to_dvi(tex_file):"-output-directory=" + TEX_DIR,tex_file,">",- get_null()+ os.devnull]exit_code = os.system(" ".join(commands))if exit_code != 0:@@ -92,7 +86,7 @@ def dvi_to_svg(dvi_file, regen_if_exists=False):"-o",result,">",- get_null()+ os.devnull]os.system(" ".join(commands))return resultdiff --git a/old_projects/bell.py b/old_projects/bell.pyindex ac0513fe5..7ba81ba3f 100644--- a/old_projects/bell.py+++ b/old_projects/bell.py@@ -2010,7 +2010,7 @@ class VennDiagramProofByContradiction(Scene):else:rejected.append((x, y))rejected.sort(- kay=lambda (x, y): (x**2 + y**2)+ kay=lambda x, y: (x**2 + y**2))for i in range(len(photons) - len(pairs)):pairs.append(rejected.pop())diff --git a/old_projects/borsuk.py b/old_projects/borsuk.pyindex a827831ca..6c87510ac 100644--- a/old_projects/borsuk.py+++ b/old_projects/borsuk.py@@ -213,9 +213,7 @@ class IntroduceStolenNecklaceProblem(ThreeDScene):self.play(FadeOut(self.title))for jewel_type, label in zip(jewel_types, enumeration_labels):jewel_type.submobjects.sort(- key=- y=lambda m: m1.get- )+ key=lambda m: m1.get)jewel_type.save_state()jewel_type.generate_target()