| 18 | |
| 19 | |
| 20 | class Init(GitSimBaseCommand): |
| 21 | def __init__(self): |
| 22 | super().__init__() |
| 23 | self.cmd += f"{type(self).__name__.lower()}" |
| 24 | |
| 25 | def init_repo(self): |
| 26 | pass |
| 27 | |
| 28 | def construct(self): |
| 29 | if not settings.stdout and not settings.output_only_path and not settings.quiet: |
| 30 | print(f"{settings.INFO_STRING} {self.cmd}") |
| 31 | |
| 32 | self.show_intro() |
| 33 | self.add_details() |
| 34 | self.recenter_frame() |
| 35 | self.scale_frame() |
| 36 | self.fadeout() |
| 37 | self.show_outro() |
| 38 | |
| 39 | def add_details(self): |
| 40 | self.camera.frame.scale_to_fit_width(18 * 1.1) |
| 41 | project_root = m.Rectangle( |
| 42 | height=9.0, |
| 43 | width=18.0, |
| 44 | color=self.fontColor, |
| 45 | ) |
| 46 | |
| 47 | cmd_text = m.Text( |
| 48 | self.cmd, |
| 49 | font=self.font, |
| 50 | font_size=36, |
| 51 | color=self.fontColor, |
| 52 | ) |
| 53 | cmd_text.align_to(project_root, m.UP).shift(m.UP * 0.25 + cmd_text.height) |
| 54 | |
| 55 | project_root_text = m.Text( |
| 56 | os.path.basename(os.getcwd()) + "/", |
| 57 | font=self.font, |
| 58 | font_size=20, |
| 59 | color=self.fontColor, |
| 60 | ) |
| 61 | project_root_text.align_to(project_root, m.LEFT).align_to( |
| 62 | project_root, m.UP |
| 63 | ).shift(m.RIGHT * 0.25).shift(m.DOWN * 0.25) |
| 64 | |
| 65 | dot_git_text = m.Text( |
| 66 | ".git/", |
| 67 | font=self.font, |
| 68 | font_size=20, |
| 69 | color=self.fontColor, |
| 70 | ) |
| 71 | dot_git_text.align_to(project_root_text, m.UP).shift(m.DOWN).align_to( |
| 72 | project_root_text, m.LEFT |
| 73 | ).shift(m.RIGHT * 0.5) |
| 74 | |
| 75 | head_text = ( |
| 76 | m.Text("HEAD", font=self.font, color=self.fontColor, font_size=20) |
| 77 | .align_to(dot_git_text, m.UP) |