Skip to content

Commit 9161676

Browse files
Capitalize enum keys
Signed-off-by: Jacob Stopak <[email protected]>
1 parent 6725e30 commit 9161676

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

git_sim/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def main(
208208
config.background_color = WHITE
209209

210210
if settings.transparent_bg:
211-
settings.img_format = ImgFormat.png
211+
settings.img_format = ImgFormat.PNG
212212

213213
t = datetime.datetime.fromtimestamp(time.time()).strftime("%m-%d-%y_%H-%M-%S")
214214
config.output_file = "git-sim-" + ctx.invoked_subcommand + "_" + t + ".mp4"

git_sim/animations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
from manim.utils.file_ops import open_file
1212

1313
from git_sim.settings import settings
14+
from git_sim.enums import VideoFormat
1415

1516

1617
def handle_animations(scene: Scene) -> None:
1718
scene.render()
1819

19-
if settings.video_format == "webm":
20+
if settings.video_format == VideoFormat.WEBM:
2021
webm_file_path = str(scene.renderer.file_writer.movie_file_path)[:-3] + "webm"
2122
cmd = f"ffmpeg -y -i {scene.renderer.file_writer.movie_file_path} -hide_banner -loglevel error -c:v libvpx-vp9 -crf 50 -b:v 0 -b:a 128k -c:a libopus {webm_file_path}"
2223
print("Converting video output to .webm format...")

git_sim/enums.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class StyleOptions(Enum):
2727

2828

2929
class VideoFormat(str, Enum):
30-
mp4 = "mp4"
31-
webm = "webm"
30+
MP4 = "mp4"
31+
WEBM = "webm"
3232

3333

3434
class ImgFormat(str, Enum):
35-
jpg = "jpg"
36-
png = "png"
35+
JPG = "jpg"
36+
PNG = "png"

git_sim/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Settings(BaseSettings):
1414
n = 5
1515
files: Union[List[pathlib.Path], None] = None
1616
hide_first_tag = False
17-
img_format: ImgFormat = ImgFormat.jpg
17+
img_format: ImgFormat = ImgFormat.JPG
1818
INFO_STRING = "Simulating: git"
1919
light_mode = False
2020
transparent_bg = False
@@ -30,7 +30,7 @@ class Settings(BaseSettings):
3030
show_outro = False
3131
speed = 1.5
3232
title = "Git-Sim, by initialcommit.com"
33-
video_format: VideoFormat = VideoFormat.mp4
33+
video_format: VideoFormat = VideoFormat.MP4
3434
stdout = False
3535
output_only_path = False
3636
quiet = False

0 commit comments

Comments
 (0)