|
21 | 21 | import git_sim.stash |
22 | 22 | import git_sim.status |
23 | 23 | import git_sim.tag |
24 | | -from git_sim.settings import ImgFormat, Settings, VideoFormat |
| 24 | +from git_sim.settings import ImgFormat, VideoFormat, settings |
25 | 25 |
|
26 | 26 | app = typer.Typer() |
27 | 27 |
|
28 | 28 |
|
29 | 29 | @app.callback(no_args_is_help=True) |
30 | 30 | def main( |
31 | 31 | animate: bool = typer.Option( |
32 | | - Settings.animate, |
| 32 | + settings.animate, |
33 | 33 | help="Animate the simulation and output as an mp4 video", |
34 | 34 | ), |
35 | 35 | auto_open: bool = typer.Option( |
36 | | - Settings.auto_open, |
| 36 | + settings.auto_open, |
37 | 37 | "--auto-open", |
38 | 38 | " /-d", |
39 | 39 | help="Enable / disable the automatic opening of the image/video file after generation", |
40 | 40 | ), |
41 | 41 | img_format: ImgFormat = typer.Option( |
42 | | - Settings.img_format, |
| 42 | + settings.img_format, |
43 | 43 | help="Output format for the image files.", |
44 | 44 | ), |
45 | 45 | light_mode: bool = typer.Option( |
46 | | - Settings.light_mode, |
| 46 | + settings.light_mode, |
47 | 47 | "--light-mode", |
48 | 48 | help="Enable light-mode with white background", |
49 | 49 | ), |
50 | 50 | logo: pathlib.Path = typer.Option( |
51 | | - Settings.logo, |
| 51 | + settings.logo, |
52 | 52 | help="The path to a custom logo to use in the animation intro/outro", |
53 | 53 | ), |
54 | 54 | low_quality: bool = typer.Option( |
55 | | - Settings.low_quality, |
| 55 | + settings.low_quality, |
56 | 56 | "--low-quality", |
57 | 57 | help="Render output video in low quality, useful for faster testing", |
58 | 58 | ), |
59 | 59 | max_branches_per_commit: int = typer.Option( |
60 | | - Settings.max_branches_per_commit, |
| 60 | + settings.max_branches_per_commit, |
61 | 61 | help="Maximum number of branch labels to display for each commit", |
62 | 62 | ), |
63 | 63 | max_tags_per_commit: int = typer.Option( |
64 | | - Settings.max_tags_per_commit, |
| 64 | + settings.max_tags_per_commit, |
65 | 65 | help="Maximum number of tags to display for each commit", |
66 | 66 | ), |
67 | 67 | media_dir: pathlib.Path = typer.Option( |
68 | | - Settings.media_dir, |
| 68 | + settings.media_dir, |
69 | 69 | help="The path to output the animation data and video file", |
70 | 70 | ), |
71 | 71 | outro_bottom_text: str = typer.Option( |
72 | | - Settings.outro_bottom_text, |
| 72 | + settings.outro_bottom_text, |
73 | 73 | help="Custom text to display below the logo during the outro", |
74 | 74 | ), |
75 | 75 | outro_top_text: str = typer.Option( |
76 | | - Settings.outro_top_text, |
| 76 | + settings.outro_top_text, |
77 | 77 | help="Custom text to display above the logo during the outro", |
78 | 78 | ), |
79 | 79 | reverse: bool = typer.Option( |
80 | | - Settings.reverse, |
| 80 | + settings.reverse, |
81 | 81 | "--reverse", |
82 | 82 | "-r", |
83 | 83 | help="Display commit history in the reverse direction", |
84 | 84 | ), |
85 | 85 | show_intro: bool = typer.Option( |
86 | | - Settings.show_intro, |
| 86 | + settings.show_intro, |
87 | 87 | help="Add an intro sequence with custom logo and title", |
88 | 88 | ), |
89 | 89 | show_outro: bool = typer.Option( |
90 | | - Settings.show_outro, |
| 90 | + settings.show_outro, |
91 | 91 | help="Add an outro sequence with custom logo and text", |
92 | 92 | ), |
93 | 93 | speed: float = typer.Option( |
94 | | - Settings.speed, |
| 94 | + settings.speed, |
95 | 95 | help="A multiple of the standard 1x animation speed (ex: 2 = twice as fast, 0.5 = half as fast)", |
96 | 96 | ), |
97 | 97 | title: str = typer.Option( |
98 | | - Settings.title, |
| 98 | + settings.title, |
99 | 99 | help="Custom title to display at the beginning of the animation", |
100 | 100 | ), |
101 | 101 | video_format: VideoFormat = typer.Option( |
102 | | - Settings.video_format.value, |
| 102 | + settings.video_format.value, |
103 | 103 | help="Output format for the animation files.", |
104 | 104 | case_sensitive=False, |
105 | 105 | ), |
106 | 106 | ): |
107 | | - Settings.animate = animate |
108 | | - Settings.auto_open = auto_open |
109 | | - Settings.img_format = img_format |
110 | | - Settings.light_mode = light_mode |
111 | | - Settings.logo = logo |
112 | | - Settings.low_quality = low_quality |
113 | | - Settings.max_branches_per_commit = max_branches_per_commit |
114 | | - Settings.max_tags_per_commit = max_tags_per_commit |
115 | | - Settings.media_dir = media_dir |
116 | | - Settings.outro_bottom_text = outro_bottom_text |
117 | | - Settings.outro_top_text = outro_top_text |
118 | | - Settings.reverse = reverse |
119 | | - Settings.show_intro = show_intro |
120 | | - Settings.show_outro = show_outro |
121 | | - Settings.speed = speed |
122 | | - Settings.title = title |
123 | | - Settings.video_format = video_format |
| 107 | + settings.animate = animate |
| 108 | + settings.auto_open = auto_open |
| 109 | + settings.img_format = img_format |
| 110 | + settings.light_mode = light_mode |
| 111 | + settings.logo = logo |
| 112 | + settings.low_quality = low_quality |
| 113 | + settings.max_branches_per_commit = max_branches_per_commit |
| 114 | + settings.max_tags_per_commit = max_tags_per_commit |
| 115 | + settings.media_dir = media_dir |
| 116 | + settings.outro_bottom_text = outro_bottom_text |
| 117 | + settings.outro_top_text = outro_top_text |
| 118 | + settings.reverse = reverse |
| 119 | + settings.show_intro = show_intro |
| 120 | + settings.show_outro = show_outro |
| 121 | + settings.speed = speed |
| 122 | + settings.title = title |
| 123 | + settings.video_format = video_format |
124 | 124 |
|
125 | 125 |
|
126 | 126 | app.command()(git_sim.add.add) |
|
0 commit comments