| 20 | |
| 21 | |
| 22 | class Config(GitSimBaseCommand): |
| 23 | def __init__(self, l: bool, settings: List[str]): |
| 24 | super().__init__() |
| 25 | self.l = l |
| 26 | self.settings = settings |
| 27 | self.time_per_char = 0.05 |
| 28 | |
| 29 | for i, setting in enumerate(self.settings): |
| 30 | if " " in setting: |
| 31 | self.settings[i] = f'"{setting}"' |
| 32 | |
| 33 | if self.l: |
| 34 | self.cmd += f"{type(self).__name__.lower()} {'--list'}" |
| 35 | else: |
| 36 | self.cmd += f"{type(self).__name__.lower()} {' '.join(self.settings)}" |
| 37 | |
| 38 | def construct(self): |
| 39 | if not settings.stdout and not settings.output_only_path and not settings.quiet: |
| 40 | print(f"{settings.INFO_STRING} {self.cmd}") |
| 41 | |
| 42 | self.show_intro() |
| 43 | self.add_details() |
| 44 | self.recenter_frame() |
| 45 | self.scale_frame() |
| 46 | self.fadeout() |
| 47 | self.show_outro() |
| 48 | |
| 49 | def add_details(self): |
| 50 | down_shift = m.DOWN * 0.5 |
| 51 | project_root = m.Rectangle( |
| 52 | height=9.0, |
| 53 | width=18.0, |
| 54 | color=self.fontColor, |
| 55 | ).move_to((0, 1000, 0)) |
| 56 | self.camera.frame.scale_to_fit_width(18 * 1.1) |
| 57 | self.camera.frame.move_to(project_root.get_center()) |
| 58 | |
| 59 | cmd_text = m.Text( |
| 60 | self.trim_cmd(self.cmd, 50), |
| 61 | font=self.font, |
| 62 | font_size=36, |
| 63 | color=self.fontColor, |
| 64 | ) |
| 65 | cmd_text.align_to(project_root, m.UP).shift(m.UP * 0.25 + cmd_text.height) |
| 66 | |
| 67 | project_root_text = m.Text( |
| 68 | os.path.basename(os.getcwd()) + "/", |
| 69 | font=self.font, |
| 70 | font_size=20, |
| 71 | color=self.fontColor, |
| 72 | ) |
| 73 | project_root_text.align_to(project_root, m.LEFT).align_to( |
| 74 | project_root, m.UP |
| 75 | ).shift(m.RIGHT * 0.25).shift(m.DOWN * 0.25) |
| 76 | |
| 77 | dot_git_text = m.Text( |
| 78 | ".git/", |
| 79 | font=self.font, |